In Java, it’s not so hard to find the specific files you need from a directory. You can easily do that with the code below:
final String directory = \\path\to\directory\;
final File file = new File(directory); File[] matchingFiles = file.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return !name.startsWith("myfile") && !name.endsWith("txt"); } });
The first file =
matchingFiles[0];
The second file =
matchingFiles[1];
and so on