getting filename from tFileInputDelimited

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

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

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch