Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Aish123
Contributor
Contributor

How to read multiple files one by one in talend

Hi,

 

I have multiple .txt files in one folder. I want to read one file at a time and then move that file to a different folder.

 

I am using tfilelist--->iterate-->tfileInputMSPositional-->tfileOutputMSpositional .

 

At tfilelist-->iterate -->tfilecopy

 

In my current scenario all the files present in the source directory are read and processed to form the output.

 

But my requirement is to first read only 1st file from the folder then convert into a required output file and then move it to another folder.

After this the new file will be read from the source directory and so on.

 

Please help resolve this issue.

 

Thank you.

Labels (2)
4 Replies
Anonymous
Not applicable

Hi
Change the job design to:
tfilelist--->iterate-->tfileInputMSPositional-->tfileOutputMSpositional-oncomponentOK--tFileCopy

Regards
Shong
Aish123
Contributor
Contributor
Author

Hi Shong,

 

Thanks for the reply.

 

I tried as you mentioned above, but it is reading all the files and creating an output but only 1 file(current filepath) is removed from the source location and getting stored in the another(completed) folder.

 

Instead i want to only read one file from the source folder --> create an output and then store that input file in "completed" folder. This should be done in loop so once this execution is finished, tfilelist will read the 2nd file process it and and will store it in "completed" folder.

 

Basic settings for tfileInputMSpositional-->((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

 

Basic settings for tfilecopy also remains same for the filename only the directory changes.

 

Thank you.

 

Aish123
Contributor
Contributor
Author

Hi @shong ,

 

Can you please provide your inputs on this.

 

Thank you.

Anonymous
Not applicable

To me, my job should work as expected, the file path of tFileCopy is the same as tFileInputMspositional,
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

Can you confirm it?

Regards
Shong