How to get a File Name

Five 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.


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.

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

Talend Studio Improvements for API Services

Taken a look at the Talend Studio improvements for API Services

Watch Now

Data Integration Success Stories

Take a look at some Data Integration success stories

Read