Here you can find the source of importCsv(File file)
public static List<String> importCsv(File file) throws Exception
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> importCsv(File file) throws Exception { List<String> dataList = new ArrayList<String>(); BufferedReader br = null; try {//from w w w . ja v a 2s.co m br = new BufferedReader(new FileReader(file)); String line = ""; while ((line = br.readLine()) != null) { dataList.add(line); } } catch (Exception e) { throw e; } finally { if (br != null) { try { br.close(); br = null; } catch (IOException e) { e.printStackTrace(); } } } return dataList; } }