String path = "D:\\bak";
String outPath = "D:\\";
FileWriter fw = null;
OutputStreamWriter outputStream = null;
FileOutputStream fileOutputStream = null;
BufferedReader reader = null;
File file = new File(path);
File[] files = file.listFiles();
int line = 0;
for (int i = 0; i < files.length; i++) {
String filePath = files[i].getPath();
String fileName = files[i].getName();
// reader = new BufferedReader(new FileReader(new File(filePath)));
FileInputStream fr = new FileInputStream(filePath);
InputStreamReader is = new InputStreamReader(fr, "UTF-8");
reader = new BufferedReader(is);
String tempString = "";
String str = "";
while ((tempString = reader.readLine()) != null) {
if (!"".equals(tempString) && tempString.indexOf("hhhj") == -1) {
// String[] strs = tempString.split("\\|#\\$\\|");
// for (int j = 0; j < strs.length; j++) {
// System.out.println(strs[j]);
// }
fileOutputStream = new FileOutputStream(outPath+fileName,true);
outputStream = new OutputStreamWriter(fileOutputStream, "UTF-8");
outputStream.write(tempString);
outputStream.write("\r\n");
outputStream.flush();
}
line++;
}
}
String outPath = "D:\\";
FileWriter fw = null;
OutputStreamWriter outputStream = null;
FileOutputStream fileOutputStream = null;
BufferedReader reader = null;
File file = new File(path);
File[] files = file.listFiles();
int line = 0;
for (int i = 0; i < files.length; i++) {
String filePath = files[i].getPath();
String fileName = files[i].getName();
// reader = new BufferedReader(new FileReader(new File(filePath)));
FileInputStream fr = new FileInputStream(filePath);
InputStreamReader is = new InputStreamReader(fr, "UTF-8");
reader = new BufferedReader(is);
String tempString = "";
String str = "";
while ((tempString = reader.readLine()) != null) {
if (!"".equals(tempString) && tempString.indexOf("hhhj") == -1) {
// String[] strs = tempString.split("\\|#\\$\\|");
// for (int j = 0; j < strs.length; j++) {
// System.out.println(strs[j]);
// }
fileOutputStream = new FileOutputStream(outPath+fileName,true);
outputStream = new OutputStreamWriter(fileOutputStream, "UTF-8");
outputStream.write(tempString);
outputStream.write("\r\n");
outputStream.flush();
}
line++;
}
}