1300102,北京市 1300103,北京市 1300104,北京市 1300105,北京市 1300106,北京市 1300107,北京市 1300108,北京市 1300109,北京市 1300110,北京市 1300111,北京市 1300112,北京市 1300113,北京市 1300114,北京市 1300115,北京市 1300116,北京市 1300117,北京市 1300118,北京市 1300119,北京市
public static void main(String args[]) {
File file = null;
BufferedReader br = null;
StringBuffer buffer = null;
String childPath = "src/endlist.txt";
String data = "";
try {
file = new File(childPath);
buffer = new StringBuffer();
InputStreamReader isr = new InputStreamReader(new FileInputStream(file), "utf-8");
br = new BufferedReader(isr);
int s;
while ((s = br.read()) != -1) {
buffer.append((char) s);
}
data = buffer.toString();
} catch (Exception e) {
e.printStackTrace();
}
Map<String, ArrayList<String>> resultMap = new HashMap<String, ArrayList<String>>();
for (int i = 0; i < 10; i++) {
resultMap.put("13" + i, new ArrayList<String>());
}
Pattern pattern = Pattern.compile("(\\d{3})(\\d{4},[\u4e00-\u9fa5]*\\n)");
Matcher matcher = pattern.matcher(data);
while (matcher.find()) {
resultMap.get(matcher.group(1)).add(matcher.group(2));
}
for (int i = 0; i < 10; i++) {
if (resultMap.get("13" + i).size() > 0) {
try {
File outFile = new File("src/13" + i + ".txt");
FileOutputStream outputStream = new FileOutputStream(outFile);
OutputStreamWriter writer = new OutputStreamWriter(outputStream, "utf-8");
ArrayList<String> tempList = resultMap.get("13" + i);
for (int j = 0; j < tempList.size(); j++) {
writer.append(resultMap.get("13" + i).get(j));
}
writer.close();
outputStream.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有