diff --git a/README.md b/README.md index f8142e9..d1e860f 100644 --- a/README.md +++ b/README.md @@ -5,25 +5,25 @@ Very tiny Java CSV parser based on Java 8 Streaming API and Lombok that is simpl ### Sample ```java -Path path=Path.of("some-file.csv"); +Path path = Path.of("some-file.csv"); - SexyCSV parser=SexyCSV.builder() - .delimiter(",") - .hasHeader(true) //auto-use of the given header - //.header(Arrays.asList("id", "name", "age", "country")) set manual headers - .skipRows(3) - .rowFilter(s->s.matches("^\\d.*")) //we are only interested in rows that start with a number - //.tokenizer(s -> s.split(";")) optional custom tokenizer - .build(); +SexyCSV parser=SexyCSV.builder() +.delimiter(",") +.hasHeader(true) //auto-use of the given header +//.header(Arrays.asList("id", "name", "age", "country")) set manual headers +.skipRows(3) +.rowFilter(s->s.matches("^\\d.*")) //we are only interested in rows that start with a number +//.tokenizer(s -> s.split(";")) optional custom tokenizer +.build(); - List data=parser.parse(path) - .collect(Collectors.toList()); +List data=parser.parse(path) +.collect(Collectors.toList()); - Row firstRow=data.get(0); +Row firstRow=data.get(0); // Access cells - String a=row.get(1); - String b=row.get("columnName") +String a=row.get(1); +String b=row.get("columnName") ```