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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

FileId need to generate for list of files.

Hi,

 

I am new to talend tool.

 

I am trying to load data into Database table for multiple files with same structure.

So I have used tFileList and Iterate for each file and loaded the files.

But my requirment is load all the files into stage table with Fileid for each files.

 

I am attaching the screenshot for the same.

 

Example :

 

file1.txt

id,name,state,country

011,aa,TX,US

012,bb,NC,US

 

file2.txt

id,name,state,country

123,cc,NY,US

456,dd,CA,US

 

 

Target

fileid,seqno,id,name,state,country.filename

1,1,011,aa,TX,US,file1.txt

1,2,012,bb,NC,US,file1.txt

2,3,123,cc,NY,US,file2.txt

2,4,656,dd,CA,US,file2.txt

 

 

Fileid should be same for all the records if it is coming from same file.

 

Please let me know how can we achieve this in talend? please do needful.

 

0683p000009Lt2H.jpg

 

 

 

 

 

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

This one is simple. When you iterate over files using the tFileList, it keeps track of the number of files currently iterated over. It is stored in the globalMap as tFileList_{number of component}_NB_FILE. You can use this in your tMap.

This post shows you how to find these globalMap values easily....
https://community.talend.com/t5/Design-and-Development/resolved-Where-can-I-Find-all-quot-globalMap-...

View solution in original post

4 Replies
Anonymous
Not applicable
Author

This one is simple. When you iterate over files using the tFileList, it keeps track of the number of files currently iterated over. It is stored in the globalMap as tFileList_{number of component}_NB_FILE. You can use this in your tMap.

This post shows you how to find these globalMap values easily....
https://community.talend.com/t5/Design-and-Development/resolved-Where-can-I-Find-all-quot-globalMap-...
Anonymous
Not applicable
Author

hi,

 Please find the attachments of desired outputs0683p000009Lsps.png0683p000009Lshr.png.


Capture.PNG
Capture2.PNG
Anonymous
Not applicable
Author

Thanks Richard!!!

Anonymous
Not applicable
Author

@nannan many thanks for your details explanation. it worked as expected 0683p000009MACn.png