How to get Same input File dynamically to the output file

Highlighted
Nine Stars

How to get Same input File dynamically to the output file

Hello All

 

Am reading files from tfilelist, and in the output file i do a column filename ,and am able to print file name in that column by using this code in tMap corresponding to column "((String)globalMap.get("tFileList_1_CURRENT_FILE")) " it works and am able to a file name but , if i use same thing in tfileouputdelimited to get that file i used

below in the component at outputdelimited 

"C:/Users/"+((String)globalMap.get("tFileList_1_CURRENT_FILE"))+TalendDate.formatDate("yyyyMMddHHmmss", new Date()) +".csv",

 

But am getiing the file as null followed by timestamp , how i resolve this issue.  "null20191017160704"

 

 

Thanks

Manish

Sixteen Stars TRF
Sixteen Stars

Re: How to get Same input File dynamically to the output file

That's normal because components are executed in the order they are on the subjob. For example, tJava starts first, as lookup for tMap. For tFileInputDelimited, the output filename is assigned when the subjob starts. So you need to break the flow with tFlowToIterate then, as tFileInputDelimited requires an input flow, you need to initiate a new one with tFixedFlowInput, using global variables issued from tFlowToIterate.

TRF

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 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog