日期:2014-05-20 浏览次数:20783 次
import java.io.BufferedReader; import java.io.FileReader; public class ReadCSV { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new FileReader("c:/2009.csv")); String line ; while((line = br.readLine())!=null){ System.out.println(line.split(",")[0]); } br.close(); } }
------解决方案--------------------
改成line.split(",.*")[0] 效率更高点