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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rename output file

Simple ask, looking for an example on renaming output files at the end of iteration (I'm looping through multiple files and need multiple output files with a similar name. i.e. 123.xls to 123_out.xls)
Haven't seen a decent example digging through the forums...
Seems like a simple need that could be accomplished without script.
Labels (2)
9 Replies
blackfox
Contributor III
Contributor III

have a look at tFileCopy and set rename and delete source checkbox
Anonymous
Not applicable
Author

Unless I'm missing something (and maybe I am, I'm new to the tool) there is no set rename.
Just values to set the file to be copied and the destination folder for it to be copied to. It would sense to have a field to set the destination name as well.
For additional context here's what I want to do
------------------------------
| in file | outfile |
------------------------------
| 123.xls |123_out.xls |
| abc.xls |abc_out.xls |
------------------------------
I guess the alternative would be to write the file with the right name when the flow is initiated, but I'm not seeing a logical way to send a variable file name to tFileOutputExcel for example.
Anonymous
Not applicable
Author

Hi
Does the tFileCopy fit your need? "out" is a fixed value or it should be a dynamical value?
Best regards
Shong
Anonymous
Not applicable
Author

No. It does tFileCopy does not. It needs to be a dynamic value. I'm processing multiple files and need multiple outputs with similar but different names.
blackfox
Contributor III
Contributor III

here is a screenshot of a tFileCopy-Componentview which I use to rename a file. The labels are in German, but you may find it helpful anyway. Notice, that some fields become visible only if you set the checkboxes which activate them ("umbenennen" => "Zieldateiname").
Anonymous
Not applicable
Author

if you know Java you can try file.rename method to rename the files.
Anonymous
Not applicable
Author

Looking at Blackfox's post, there's a delta in functionallity between the Perl version of the tFileCopy vs the Java version. It would appear the Java version supports the rename functionality and the Perl does not. Unfortunately I need it in the Perl version for some of the pivot table functions that are not in Java version.
This is for R4.1.2.
Anyway to fix or log a bug?
Anonymous
Not applicable
Author

Hi
It is not a bug, we can say it is a feature in Perl version. There is no relationship between Java project and Perl project, they are developed separately. I suggest you to use Java project because there are more than features than Perl version, and more Java developers and users here.
Best regards
Shong
Anonymous
Not applicable
Author

Interesting POV.
2 followup questions then:
1) Is there a developer guide. I'll take a swing at fixing it, just for giggles.
2) Is there a Java equivalent to tPivottoRows other than tUnpivotRow which hasn't been updated recently. I need to blow out an Xcel table into key value pairs so I can do historical analysis.