Six 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
3 REPLIES
Seven Stars sgv
Seven 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.

Six Stars

Re: how to get data using tfilelist component

Thank for your reply. can i get that java code

Seven Stars sgv
Seven 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