Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I'm still pretty new to Talend and need some help with tFileList.
I am basically wanting Talend to read the contents of a directory and output the filenames of all the files into a data table.
To start I created a job to see if I could out the filenames to a tLogRow, so I did this.
tFileList_1 >> tFileProperties_1 >> tMap >> (basename column) >> tLogRow_1
tFileList - Directory is set (using a context variable).
tFileProperties - "File" set to ((String)globalMap.get("tFileList_1_CURRENT_FILE"))
But my tLogRow output has NULL in the basename column.
Thanks
Steve
Can anyone tell me why? I'm not a java developer (just a SQL developer).
change
((String)globalMap.get("tFileList_1_CURRENT_FILE"))
to
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
Even though you identify the directory in the fileList you'll still need to specify the full path in the fileProperties
CURRENT_FILE is just the filename
change
((String)globalMap.get("tFileList_1_CURRENT_FILE"))
to
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
Even though you identify the directory in the fileList you'll still need to specify the full path in the fileProperties
CURRENT_FILE is just the filename
Thanks @evansdar
How odd though. It's quite misleading to have CURRENT_FILEPATH and CURRENT_FILE, and especially to then have CURRENT_FILE do absolutely nothing and CURRENT_FILEPATH show only the filename. Very odd