One Star

getting filename from tFileInputDelimited

Hi!
I'm trying to insert the filename into my target table. Im using tFileInputDelimited and tmap.
In tmap i put in this in the expression editor:
((String)globalMap.get("tFileInputDelimited_1_CURRENT_FILE")), but only question marks are inserted into the tables.
Any thoughts on how to do this properly?
Thanks!
5 REPLIES
One Star

Re: getting filename from tFileInputDelimited

Hi
You can't get file name from tFileInputDelimited. Because there isn't tFileInputDelimited_1_CURRENT_FILE in Talend job code.
Regards,
Pedro
One Star

Re: getting filename from tFileInputDelimited

got it, will be using fileproperties.
One Star

Re: getting filename from tFileInputDelimited

Hi,
I don't know how you have designed your job, but one way would be to use a tFileList component to achieve your requirement.
One Star

Re: getting filename from tFileInputDelimited

tFileList is not useful for me, since all my files have different schemas.
One Star

Re: getting filename from tFileInputDelimited

I have the same requirement and needs to get the current name of input.
Lets say, input file name is a.txt. I want the output file name is a_output.txt. How can I do it? 
please help.