登 录
public class Test { /** * @param args */ public static void main(String[] args) throws Exception { // TODO Auto-generated method stub BufferedReader reader=new BufferedReader(new FileReader("F://workbench//TestStruts//src//test//aa.txt")); String curLine; int lineIndex=1; while((curLine=reader.readLine())!=null){ int colIndex=curLine.indexOf("abcd"); if (colIndex>=0){ System.out.println(lineIndex+","+colIndex+":"+curLine); } lineIndex++; } } }
抱歉!评论已关闭.