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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
caioaloe_
Contributor
Contributor

Get files names and remove extensions

Hi!

I'm trying to get the files names from different .txt files,

without the extension (.txt)

, that are in .zip file. But I don't need all files names, just the files names that are in the attachment "Screenshot_6.png"

1) I don't know if I made the correct configuration on tfilelist of the files that I want (

Screenshot_6.png

);

2) I need to remove the extension of the files, but I don't know how to do that.

Can anyone help me?

Labels (3)
1 Reply
gjeremy1617088143

Hi you can write a routine with this function :

 

public static String removeFileExtension(String filename, boolean removeAllExtensions) {

if (filename == null || filename.isEmpty()) {

return filename;

}

 

String extPattern = "(?<!^)[.]" + (removeAllExtensions ? ".*" : "[^.]*$");

return filename.replaceAll(extPattern, "");

}

 

and call it in your job removeFileExtension(your file name, true)

 

send me love and kudos