scanner and arrays
hi, i have a file that can find word strings in a file using
Scanner sc =new Scanner(new File("Test.txt"));
Pattern p = Pattern.compile....
the thing is, i would like it to go through 48 different files. i'd like it to present both the total result (amount of strings found) and seperately (the amount of strings found in each file)
i have the files stored in
import java.io.*;
publicclass Mitt{
publicstaticvoid main(String[] args){
File[] corpus ={
new File("1.txt"),
new File("2.txt"),
new File("3.txt"),
new File("4.txt")//up to 48
};
for(int i = 0; i < corpus.length; i++){
findIdioms(corpus[i], corpus);
}
}
privatestaticvoid findIdioms(File essay, File[] files){
}
}
obviously it's not as easy as writing Scanner sc =new Scanner(new File("Mitt.java"));
as i thought (being a newbie) and i can't find it reading the tutorials.
Does anyone know how to solve this? if you need the entire code, i'll be happy to post it.
Thank you in advance!

