Combining Two Context variables for Tfileunarchive component to unzip a file in the same folder

Seven Stars

Combining Two Context variables for Tfileunarchive component to unzip a file in the same folder

Hello Talend Community,

 

I have a tfileunarchive component that calls on two context variable "One a Directory" one as a "Value" and a tFileList_2_CURRENT_FILE. See My attachment of the component

The Directory is my local drive on my PC and the Value is a date in a 'YYYYMMDD' format. and the file that is a Zip from tFileList2 Component. Im trying to unzip that file in the same folder.

What is the proper syntax for calling two context variables and a TfileList parameter. I am getting a Java Error on this component now with the syntax.

Current Syntax on Archive File: context.copyfilepath + context.ymd_date ((String)globalMap.get("tFileList_2_CURRENT_FILE"))

Extraction Directory: context.copyfilepath + context.ymd_date

I know the folder exists in the directory that I created with my tfileCopy component.

 

Any help would be appreciated

 

 


Accepted Solutions
Highlighted
Forteen Stars

Re: Combining Two Context variables for Tfileunarchive component to unzip a file in the same folder

1. you have missed + between context.ymd_date and global variable

2. you must add also  +"/"+ in apropriate places if your variables already do not ending with / (/ will work and for Linux and for Windows path)

-----------

All Replies
Highlighted
Forteen Stars

Re: Combining Two Context variables for Tfileunarchive component to unzip a file in the same folder

1. you have missed + between context.ymd_date and global variable

2. you must add also  +"/"+ in apropriate places if your variables already do not ending with / (/ will work and for Linux and for Windows path)

-----------

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch