I have this so far but it only prints the .txt file to the screen:
import java.io.*;
public class ReadFile {
public static void main(String[] args) throws IOException {
String Wordlist;
int Frequency;
File file = new File("file1.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
String line = null;
while( (line = br.readLine()) != null) {
String [] tokens = line.split("\\s+");
System.out.println(line);
}
}
}
Can anyone help me so it prints a word list and the words frequency?
Samuel Fernandes
30-Dec-2014