Task: overwrite file 1 to file 2, all words, but one on each line, without any punctuation (using StringTokenizer).
I have completed all the items of the task except one. Write to output file.
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.StringTokenizer; public class лаба2 { public static void main(String[] args) throws FileNotFoundException, IOException { String s; int l=0; BufferedReader in = new BufferedReader(new FileReader("F:/1.txt")); while ((s = in.readLine()) != null) { l++; StringTokenizer st; st = new StringTokenizer(s, " \t\n\r,.?"); while(st.hasMoreTokens()) { System.out.println(st.nextToken()); } } } } I can not catch up where to insert the file entry.