This repository was archived by the owner on Oct 16, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -5,25 +5,25 @@ Very tiny Java CSV parser based on Java 8 Streaming API and Lombok that is simpl
5
5
### Sample
6
6
7
7
``` java
8
- Path path= Path . of(" some-file.csv" );
8
+ Path path = Path . of(" some-file.csv" );
9
9
10
- SexyCSV parser= SexyCSV . builder()
11
- .delimiter(" ," )
12
- .hasHeader(true ) // auto-use of the given header
13
- // .header(Arrays.asList("id", "name", "age", "country")) set manual headers
14
- .skipRows(3 )
15
- .rowFilter(s- > s. matches(" ^\\ d.*" )) // we are only interested in rows that start with a number
16
- // .tokenizer(s -> s.split(";")) optional custom tokenizer
17
- .build();
10
+ SexyCSV parser= SexyCSV . builder()
11
+ .delimiter(" ," )
12
+ .hasHeader(true ) // auto-use of the given header
13
+ // .header(Arrays.asList("id", "name", "age", "country")) set manual headers
14
+ .skipRows(3 )
15
+ .rowFilter(s- > s. matches(" ^\\ d.*" )) // we are only interested in rows that start with a number
16
+ // .tokenizer(s -> s.split(";")) optional custom tokenizer
17
+ .build();
18
18
19
- List<Row > data= parser. parse(path)
20
- .collect(Collectors . toList());
19
+ List<Row > data= parser. parse(path)
20
+ .collect(Collectors . toList());
21
21
22
- Row firstRow= data. get(0 );
22
+ Row firstRow= data. get(0 );
23
23
24
24
// Access cells
25
- String a= row. get(1 );
26
- String b= row. get(" columnName" )
25
+ String a= row. get(1 );
26
+ String b= row. get(" columnName" )
27
27
28
28
29
29
```
You can’t perform that action at this time.
0 commit comments