我有一个250行的文件。我想插入线128如何在文件的特定行之后插入文本
我才发现,我可以附加在文件 结束文本像
try {
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("outfilename", true)));
out.println("the text");
out.close();
} catch (IOException e) {
//oh noes!
}
即对这个职位How to append text to an existing file in Java
但随着后发现一些文本没有提到行号或某事。
任何建议的代码来做你的建议? – jechaviz