日期:2014-05-19  浏览次数:20720 次

怎样把逐行读取的数据保存到对象中
File f = new File(file);  
try {
FileReader fr = new FileReader(f);
BufferedReader br = new BufferedReader(fr);
String line = null;
while((line = br.readLine())!=null){

System.out.println(line);

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

结果能读取出这样有规律的文件
-----------------------------------------------------
朝阳区
车龙汽车装饰(望京店)
南湖西园502号院中广宜景湾底商
4000052365
null
8:30-18:30
39.904214, 116.40741300000002

昌平区
京杰汽车服务
文华路龙锦苑四区2号楼底商
010-81746257
null
尚无营业时间
40.0822929, 116.34415969999998
-------------------------------------------------------
怎样在while循环中把每行数据付给对象的属性

------解决方案--------------------
探讨

呵呵 终于搞定了