Reputation: 121
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
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