tFileInputDelimited dynamic filename

Four Stars

tFileInputDelimited dynamic filename

<p>Hello, how to pass parameter filename to tFileInputDelimited?</p>
<p>I have to parse a file that changes daily, the filename format is <strong>somefile_yyyymmdd.csv</strong></p>
<p>So every day it will have different name</p>
<p>&nbsp;</p>
<p>In tFileInputDelimited, I have to select the file manually?</p>
Moderator

Re: tFileInputDelimited dynamic filename

Hello,

Could you please try to use a tFileList component to iterate your somefile_yyyymmdd.csv file in a given directory based on a file mask pattern?

tFileList(*.csv)-->tfileinputdelmited(((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) )-->output

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: tFileInputDelimited dynamic filename

Hello,

Depends on when you want to parse it.

If it's the same day you can use in the file name :

"somefile_" + TalendDate.getDate("yyyMMdd") + ".csv"

If you want to parse it one every week, use a tFileList then iterate into a tFileInputDelimited.

 

Hope it'll help.

Six Stars

Re: tFileInputDelimited dynamic filename

Use the below code -

((String)globalMap.get("tFileList_1_CURRENT_FILE")).replace(".csv","")+"_"+TalendDate.getDate("yyyyMMdd")+".csv"

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

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

Downloads and Trials

Test drive Talend's enterprise products.

Downloads