how to get data using tfilelist component

Eight Stars RAJ
Eight Stars

how to get data using tfilelist component

Hi All,

  • I have to do below requirement
  • I have two Hundred excel file in same folder 
  • My file name is P_19Jun2017 and P_20Jun2017. 
  • How to get data from excel files using tfilelist component based on file name (file name like Date).
  • I need to get excel file data based on max of date for tfilelist_1 component and (max of date - 1) for tfilelist_2 component
  • Then I have to do join for both file using tmap.
  • I need to create job below like screenshots.Screenshot (68).png
Thanks
RAJ
Eight Stars sgv
Eight Stars

Re: how to get data using tfilelist component

Hi ,

 

Why did you use 2 tFileList if you have only 2 files ? The iteration is useless no ?

Personnaly I take the problem more like that :

 

Capture.PNG

 

You can initialise some globalMap in tJava in function of some properties of your file.

In you tFileInput use your variable in the de name file var.

 

Good luck.

Eight Stars RAJ
Eight Stars

Re: how to get data using tfilelist component

Thank for your reply. can i get that java code

Thanks
RAJ
Eight Stars sgv
Eight Stars

Re: how to get data using tfilelist component

Create 2 contexts var String with default value = INIT

then in your tJava

if(context.file1.equals("INIT"))

{

context.file1 = ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"));

}

else

{

context.file2 = ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"));

}

 

And in the tFileList, order by "Date of Modif"

 

Or something like that .

Good luck ,

SGV

 

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

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch