java从一个较大的文本文档中查找字符串
java从一个较大的文本文档中查找字符串
public static void findStr(File fileParam) throws IOException{ FileReader fread = null; BufferedReader bufferRead = null; fread = new FileReader(fileParam); bufferRead = new BufferedReader(fread); String lineStr = ""; int lineNum=1; while((lineStr=bufferRead.readLine())!=null) { if(lineStr.contains("EPSILON")) { System.out.println("EPSILON----"+fileParam.getPath()+" "+lineNum); } lineNum++; } bufferRead.close(); fread.close(); bufferRead = null; fread = null; }
######################
QQ 3087438119