public class File_Change {
public static void main(String[] agrs) throws IOException {
new File_Change().fun();
}
public void fun() throws IOException {
FileReader fileReader = new FileReader("E:\\聊天记录.txt");
BufferedReader bufferedReader = new BufferedReader(fileReader);
FileWriter fileWriter = new FileWriter("E:\\改后聊天记录.txt");
String a[] = new String[50700];
String str = new String();
int i = 0;
while ((a[i] = bufferedReader.readLine()) != null) {
str = a[i].replaceAll(":", "→");
fileWriter.write(str);
System.out.println('\n');
i++;
return;
}
fileReader.close();
fileWriter.close();
}
}
没有任何报错,就是写出来的TXT没有内容。请问哪里不对? |
|