How to get a File Name

Six Stars

How to get a File Name

I am trying to get the file name of a file that I am trying to load to postgres database.

I see that we need to use tFileList_1_CURRENT_FILE for the current filename. Where do I give this command?

tfilelist ->tfileInputDelimited->tDBOutput is what I have right now. 


Accepted Solutions
Community Manager

Re: How to get a File Name

Assuming you are loading the file and retrieving its contents using the tFileInputDelimited, you will need to add a tMap between the tFileInputDelimited and the tDBOutput. In the tMap add another column on the output table (the data being sent to your tDBOutput) and populate it with ....

 

((String)globalMap.get("tFileList_1_CURRENT_FILE"))

For every row of data returned by your file, you will also get the file name.

View solution in original post


All Replies
Community Manager

Re: How to get a File Name

Assuming you are loading the file and retrieving its contents using the tFileInputDelimited, you will need to add a tMap between the tFileInputDelimited and the tDBOutput. In the tMap add another column on the output table (the data being sent to your tDBOutput) and populate it with ....

 

((String)globalMap.get("tFileList_1_CURRENT_FILE"))

For every row of data returned by your file, you will also get the file name.

View solution in original post

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 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 3

Read about some useful Context Variable ideas

Blog