Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I wanted to check particular prefix files are exist inside directory or not. If exist i want to perform some operation.
Tried with tFileexist -> It is checking only fully qualified file name. I want to check file exist or not with particluar prefix.
Tried with tFileList -> It is listing all files taking too much time. Simply i wanted to check is there any file exist with particular prefix.
Example:
Folder contains 1_filename1, 1_filename2, 1_filename3 , 2_filename1, 2_filename2, 2_filename3 etc..
I want to check is there any file exist with 2_*
Regards,
Ganesh.R
Hi maybe you can do this :
in a tJava
-- in advanced settings :
import java.io.File;
-- in basic settings:
File dir = new File("here your directory path");
Boolean fileExist = (dir.listFiles(file -> file.getName().matches("^2_.*"))).length>0;
send me love and kudos
Hi @guenneguez jeremy , Thanks for the solution and worked for me.
If my answer helped you, can you select it as best answer to close the ticket ?