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; }
######################
标签:文本文档,java,fread,lineNum,查找,fileParam,null,bufferRead From: https://www.cnblogs.com/herd/p/16260629.html