import java.io.*;
public class Demo {
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader (new FileReader ("aaa.txt"));
BufferedWriter bw = new BufferedWriter (new FileWriter("bbb.txt"));
String line;
while((line=br.readLine())!=null){
String s = line.replaceAll("[0-9]", "");
String s1=line .replaceAll("[a-zA-Z]", "");
bw.write(s);
bw.newLine();
bw.write(s1);
bw.newLine();
}
bw.close();
br.close();
}
} |
|