public class Demo3 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new FileReader ("E:\\a.txt"));
BufferedWriter bw = new BufferedWriter(new FileWriter("b.txt"));
int x=1;
String b;
while((b=br.readLine())!=null){
bw.write(x+":");
x++;
bw.write(b);
bw.newLine();
}
bw.close();
br.close();
}
}
|
|