码迷,mamicode.com
首页 > 其他好文 > 详细

筛选aaa=bbb;结果取aaa

时间:2015-12-08 14:36:52      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;


public class Test {
private static String[] stringlist;

public static void main(String[] args) throws Exception {


String filePath1="C:\\zlb\\ApplicationResourcesNew.txt";
String filePath2="C:\\zlb\\000.txt";
String item;
BufferedReader in=new BufferedReader(new InputStreamReader( new FileInputStream(filePath1), "utf-8"));
BufferedWriter ou=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filePath2),"utf-8"));
while((item=in.readLine())!=null){
stringlist=item.split("=");
for(int i=0;i<stringlist.length;i+=2){
ou.write(stringlist[i]);
ou.newLine();
}
}
in.close();
ou.close();
}
}

筛选aaa=bbb;结果取aaa

标签:

原文地址:http://www.cnblogs.com/bb3q/p/5028912.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!