Skip to content
arnaudroger edited this page Dec 12, 2014 · 19 revisions

Quick Start

Java 8

try (FileReader reader : new FileReader(myfile)) {
    CsvParser
        .skip(2)
        .stream(reader)
        .map(Arrays::toString)
        .forEach(System.out::println);
}

Java 7

try (FileReader reader : new FileReader(myfile)) {
    Iterator<String[]> it = CsvParser.skip(2).iterate(reader);
    while(it.hasNext()) {
        System.out.println(Arrays.toString(it.next()));
    }
}

Customised separator

try (FileReader reader : new FileReader(myfile)) {
    CsvParser
        .separator('\t').quote('\'')
        .stream(reader)
        .map(Arrays::toString)
        .forEach(System.out::println);
}
Clone this wiki locally