I have calculated the words and now displaying it in console. But I want to write the console output to a text file. how to do this?
String[] wrds = counter.getWords(WordCounter.SortOrder.BY_FREQUENCY);
int[] frequency = counter.getFrequencies(WordCounter.SortOrder.BY_FREQUENCY);
int n = counter.getEntryCount();
for (int i=0; i<n; i++)
{
This should be written in text file///// System.out.println(frequency[i] + " " + wrds[i]+" "+ counter.getWordCount());