This can be done by java project
import java.io.*;
import java.util.ArrayList;
//This class written by susantha pathirana for one time use to problem that have to open 600 files and compare client string with 166 client string and identify matching clients
//Has not followed any cording standards so do not complain on that :)
public class Test {
public static void main(String[] args) {
String fileName = "";
// The name of the folder that placed files
File folder = new File("E:\\Win2k3\\Adam\\");
File[] listOfFiles = folder.listFiles();
int count = 0;
for (File file : listOfFiles) {
if (file.isFile()) {
// System.out.println(file.getName());
// The name of the file to open.
fileName = "E:\\Win2k3\\Adam\\" + file.getName();
// This will reference one line at a time
String line = null;
try {
// FileReader reads text files in the default encoding.
FileReader fileReader = new FileReader(fileName);
// Always wrap FileReader in BufferedReader.
BufferedReader bufferedReader = new BufferedReader(
fileReader);
String arr[] = { "adanu", "aliat" };
// String arr[] = {"SH"};
ArrayList<string> t2 = new ArrayList<string>();
// To read file and fill line by line to array list
while ((line = bufferedReader.readLine()) != null) {
t2.add(line);
}
outerloop: for (int j = 0; j < t2.size(); j++) {
for (int k = 0; k < arr.length; k++) {
if ((t2.get(j)).contains(arr[k])) {
// String x = (t2.get(j));
// String y = (arr[k]);
System.out.println(t2 + "," + (arr[k]));
System.out
.println("--------------------------------------------------------------------");
count++;
break outerloop;
}
}
}
// Always close files.
bufferedReader.close();
} catch (FileNotFoundException ex) {
System.out
.println("Unable to open file '" + fileName + "'");
} catch (IOException ex) {
System.out.println("Error reading file '" + fileName + "'");
// Or we could just do this:
// ex.printStackTrace();
}
}
}
System.out.println("Selected EPs" + count);
}
}
<pre lang="java">