1.读入一个文本,如d:sp.txt
(例如文本的内容:
E:\test\dbo.Add_sp.PRC(1): SET @vcReturnMessage3 ='Table: inbnd_Equipment_tbl'D:\sp\dbo.Del_CntrAdd_sp.PRC(5): inbnd_Equipment_tbl and out_Date_tbl.......
)
2.查询文本的内容比如说查询PRC和tbl 把含有这两个字符的字符串找出来输出到一个新的txt里
比如d:output.txt,查询过程中遇到一行有几个结果的中间以逗号隔开。比如文中的输出结果为
dbo.Add_sp.PRC: inbnd_Equipment_tbldbo.Del_CntrAdd_sp.PRC: inbnd_Equipment_tbl,out_Date_tbl.......
(例如文本的内容:
E:\test\dbo.Add_sp.PRC(1): SET @vcReturnMessage3 ='Table: inbnd_Equipment_tbl'D:\sp\dbo.Del_CntrAdd_sp.PRC(5): inbnd_Equipment_tbl and out_Date_tbl.......
)
2.查询文本的内容比如说查询PRC和tbl 把含有这两个字符的字符串找出来输出到一个新的txt里
比如d:output.txt,查询过程中遇到一行有几个结果的中间以逗号隔开。比如文中的输出结果为
dbo.Add_sp.PRC: inbnd_Equipment_tbldbo.Del_CntrAdd_sp.PRC: inbnd_Equipment_tbl,out_Date_tbl.......
BufferedReader in = new BufferedReader(t);
PrintWriter out = new PrintWriter(new FileOutputStream("output.txt"));
while((line = in.readLine())!=null)
{
if ((line.indexOf("PRC") !=-1 )&&(line.indexOf("tbl")!=-1))
out.println(line);}
int spTo = line.indexof(.PRC)
string spName = line.substring(from,to)list aaa = line.split("")
list[i] tbl如果能给个源码就太感谢了