Ashish B Sathish
Ashish B Sathish

Reputation: 121

How do I update the source file name in Talend

I have the source file on HDFS and I want to write the output file with a new column to have the name of the source file for each row. I have my Talend job like:

tHDFSGet --> tInputFilePositional --> tmap --> tfileoutputfile

Please help get the file name for each row in the new column.

Upvotes: 0

Views: 328

Answers (1)

Ashish B Sathish
Ashish B Sathish

Reputation: 121

Used thdfsList to get the filename in it and used

StringHandling.RIGHT(StringHandling.LEFT(((String)globalMap.get("tHDFSList_2_CURRENT_FILEPATH")),StringHandling.LEN(((String)globalMap.get("tHDFSList_2_CURRENT_FILEPATH")))+6),7) 

This trimmed the filepath to just the filename.

Upvotes: 0

Related Questions