package find_text; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; public abstract class ReadFile { protected String fileName=null; protected int rowNum=0; public void readFile(String filein) { try { fileName=filein; String str; BufferedReader in = new BufferedReader(new InputStreamReader( new FileInputStream(filein), "UTF-8"));//如有乱码,请改为<UTF-8>或<GBK> while ((str = in.readLine()) != null) { chuLi(str); } in.close(); } catch (IOException e) { e.printStackTrace(); } } public abstract String chuLi(String str); }
最近下载更多