1.java读取txt文件
File rfile = new File("F:\\books\\cluster3.txt");
BufferedReader rbr = new BufferedReader(new FileReader(rfile));
while((tmp=rbr.readLine())!=null ){
System.out.println(tmp);
}
2.java写txt文件
File wfile = new File("F:\\books\\book.txt");
BufferedWriter wbr = new BufferedWriter(new FileWriter(wfile,true));
while((tmp=rbr.readLine())!=null){
wbr.write("Hello World!");
wbr.newLine();
wbr.flush();
}