Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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