62,614
社区成员
发帖
与我相关
我的任务
分享
我的代码如下
BufferedReader br = null;
PrintWriter pw = null;
String str = null;
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream("E:iptv_CCTV_AUTO_scheduler.log")));
pw = new PrintWriter(new FileWriter("E:/25_new.txt"),true);
while(br.readLine() != null){
str = br.readLine();
if(str.indexOf("INFO") != -1){
pw.println(str);
}
if(str.indexOf("ConnectCount") != -1){
pw.println(str);
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally{
try {
pw.flush();
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}