try
{
StringBuilder sb = new StringBuilder();
getFiles(args[0]);
if(filelist == null) {
return;
}
for(inti = 0; i
sb.append(FileToString((String)filelist.get(i)));
}
Pattern p = Pattern.compile(args[1]);
Matcher m = p.matcher(sb.toString());
while(m.find()) {
result.add(m.group(0));
}
int length = result.size();
StringBuilder sb2 = new StringBuilder();
for(intk = 0; k
sb2.append((String)result.get(k) + "\n");
}
FileOutputStream fileOutputStream = new FileOutputStream(newFile("D:\\qtfreet.txt"), true);
fileOutputStream.write(sb2.toString().getBytes("UTF-8"));
fileOutputStream.flush();
fileOutputStream.close();
System.out.println("输出完成,信息存储在D盘的qtfreet.txt中");
}
catch(Exception e)
{
System.out.println("参数输入异常");
}