File filePath = new File("D:\\AB.txt");BufferedReader br=new BufferedReader(new FileReader(filePath));while ((String s = br.readLine()) != null) { System.out.println(s + "\r\n");}////主要的代码应该差不多,你自己再修改一下就OK了...