个人观点 貌似只有这么做了
假设要读入的文件是x.txt
y.txt作为处理过的文件
InputStream in = new FileInputStream("x.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(in));
OutputStream out = new FileOutputStream("y.txt");
PrintWriter pw = new PrintWriter(out);
String s0 = "所要删除的语句";
for(;;)
{
String s = br.readLine();
if(s == s0)
continue;
if(s==null) break;