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: 
Moe1
Contributor II
Contributor II

Add text to file name

Hi,

I need to change file name from 

xxxxx_timestamp_randomnum.csv

TO

xxxxx_timestamp_randomnum_ToAdd.csv

 

However when using this

((String)globalMap.get("tFileList_1_CURRENT_FILE"))+"_toadd.csv"

The output is:

xxxxx_timestamp_randomnum.csv_toAdd.csv

Labels (2)
2 Replies
iamabhishek
Creator III
Creator III

Your final expression should be something like this - 

 

((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(1,((String)globalMap.get("tFileList_1_CURRENT_FILE")).indexOf('.')) +"_toadd" + ((String)globalMap.get("tFileList_1_CURRENT_FILEEXTENSION"))
manodwhb
Champion II
Champion II

@Moe,try with below one.

 

 

replaceAll(((String)globalMap.get("tFileList_1_CURRENT_FILE")),".csv","")+"_toadd.csv"