文件格式是这样的
处理方法为:
package com.caissa.chador_mr;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.InputStream;
import java.io.InputStreamReader;
/**
* Created by admin on 2019/1/25.
*/
public class ReadLogFile {
public static void main(String [] args){
traverseFolder2("C:\\Users\\admin\\Desktop\\新报表系统\\新日报数据");
}
/**
* 遍历文件夹
* @param path
*/
public static void traverseFolder2(String path){
File file = new File(path);
if (file.exists()) {
File[] files = file.listFiles();
if (files.length == 0) {
System.out.println("文件夹是空的!");
return;
} else {
for (File file2 : files)