CSV Scanner I think

mail@pastecode.io avatar
unknown
java
3 months ago
379 B
11
Indexable
Never
List<String[]> input = new ArrayList<>();
try (Scanner input = new Scanner(csv)) {
    while (Scanner.hasNextLine()) {
        String line = Scanner.nextLine();
        String[] values = line.split(",");
        input.add(values);
    }
} catch (Exception e) {
    System.err.println("Unable to locate file: " + e.getMessage());
}

// Now the lines should be like {id, values...}
Leave a Comment