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: 
1636848613
Contributor III
Contributor III

tFileList/tFileCopy - using to dynamically rename files from a table of name from/to values

Hi team,

I am attempting to rename a directory of files using a mapping table containing the current file name, and the name I want the file to be renamed to. I have successfully created the mapping table but struggling with the correct use of the tFileList and tFileCopy syntax.

eg:

From_Name To_Name

kjhfsdkfd34789.jpg Hat-1.jpg

asdsjk894q0dljk.jpg Hat-2.jpg

asdjklj93kl5490.jpg Pants-1.jpg

adkjsdjs9239r47.jpg Shoes-1.jpg

From what I have read I need to utilise global context variables but cant find examples that iterate through the directory and look up the desired output name.

Any assistance is greatly appreciated.

Labels (2)
1 Solution

Accepted Solutions
1636848613
Contributor III
Contributor III
Author

Thanks! Got it working as per below in case anyone else has this requirement.

 

0695b00000L1iykAAB.jpg

View solution in original post

2 Replies
billimmer
Creator III
Creator III

you could write the filepaths returned by the tFileList to a csv, hash, or temp db table - then feed that through a tmap with a lookup on the from/to names.

 

Or you can take the iterate of your tFileList and attached it to a tIterateToFlow and feed that result into a tmap with lookup.

1636848613
Contributor III
Contributor III
Author

Thanks! Got it working as per below in case anyone else has this requirement.

 

0695b00000L1iykAAB.jpg