十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
public static void main(String[]args)
{
File head=new File("D:/d/b");
File last=new File("D:/d/vv");
try(BufferedReader breader=new BufferedReader(new FileReader(head));
BufferedWriter bwriter=new BufferedWriter(new FileWriter(last))) {
//用新方法逐行读取
String line=null;
while((line=breader.readLine())!=null)
{
bwriter.write(line);//逐行写出
bwriter.newLine(); //每行写入一个换行符
bwriter.flush();
}
}catch(FileNotFoundException e)
{
e.printStackTrace();
}catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}