Skip to content
This repository was archived by the owner on Oct 16, 2023. It is now read-only.

Commit d05e5b5

Browse files
committed
dealing with missing cells using tab delimiter
1 parent 6867891 commit d05e5b5

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ Very tiny Java CSV parser based on Java 8 Streaming API and Lombok that is simpl
55
### Sample
66

77
```java
8-
Path path=Path.of("some-file.csv");
8+
Path path = Path.of("some-file.csv");
99

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();
1818

19-
List<Row> data=parser.parse(path)
20-
.collect(Collectors.toList());
19+
List<Row> data=parser.parse(path)
20+
.collect(Collectors.toList());
2121

22-
Row firstRow=data.get(0);
22+
Row firstRow=data.get(0);
2323

2424
// 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")
2727

2828

2929
```

0 commit comments

Comments
 (0)