public static List readCSVIntoList()

in Java/src/main/java/com/example/customername/CsvIO.java [11:28]


    public static List < String[] > readCSVIntoList(String filepath) throws IOException{

        System.out.println(String.format("Retreiving file from path: %1$s", filepath));
        List < String[] > rowList = new ArrayList < String[] > ();
        try (BufferedReader br = new BufferedReader(new FileReader(filepath))) {
            String line;
            while ((line = br.readLine()) != null) {
                String[] lineItems = line.split(",");
                rowList.add(lineItems);
            }
            br.close();
        } catch (IOException e) {
            System.out.println(e);
            throw e;
        }

        return rowList;
    }