Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
doyaaaaaken authored Aug 27, 2019
1 parent 11dd4ba commit 813b6c5
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,24 @@ val rows: List<List<String>> = csvReader().readAll(csvData)
val file: File = File("test.csv")
val rows: List<List<String>> = csvReader().readAll(file)
```
If you want to get ``Sequence<List<String>>``, you can use `readAsSequence` method.

If you want to handle line-by-line, you can use `readAsSequence` method and get `Sequence<List<String>>`.
```kotlin
csvReader().open("test.csv") {
readAllAsSequence().forEach { row ->
//Do something
println(row) //[a, b, c]
}
}
```

#### Read with header

```kotlin
val csvData: String = "a,b,c\nd,e,f"
val rows: List<Map<String, String>> = csvReader().readAllWithHeader(csvData)
println(rows) //[{a=d, b=e, c=f}]
```

#### Customize

Expand Down

0 comments on commit 813b6c5

Please sign in to comment.