首页 > 其他 > 详细

读取本地文本写入list

时间:2014-10-14 18:47:40      阅读:102      评论:0      收藏:0      [点我收藏+]

/**
* 读取15151433862----123456文档
* @param f
*/
private static void findContent(File f){
String line = null;
try {
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(f), "gbk"));
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
}
try {
line = br.readLine();
while(line != null){
//读取一行记录,发送http请求
String[] strArr = line.split("----");
//System.out.println(strArr[0] +"======="+ strArr[1]+"======="+strArr[2]);
try {
modify(strArr[0],strArr[1],strArr[2]);
} catch (Exception e) {
e.printStackTrace();
}
line = br.readLine();

}
} catch (IOException e) {
e.printStackTrace();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}

}

 

 

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

File filename = new File("D:/号码.txt");

}

读取本地文本写入list

原文:http://www.cnblogs.com/yy123/p/4024920.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!