doyaaaaaaken
08/23/2019, 11:37 AMdoyaaaaaaken
08/23/2019, 11:52 AMVictor Harlan Lacson
05/22/2020, 10:10 AMreadAllWithHeader(): List<Map<String, String>>
it was initially as a sequence then converted to list. so I guess the implementation is already covered.doyaaaaaaken
05/22/2020, 2:10 PMdoyaaaaaaken
05/24/2020, 10:15 PMdoyaaaaaaken
05/31/2020, 2:08 PMdoyaaaaaaken
06/01/2020, 12:44 PMVictor Harlan D. Lacson
are not shown on contributors page.
I slightly recommend to make commits connected with your acount.doyaaaaaaken
06/01/2020, 2:24 PMdoyaaaaaaken
06/09/2020, 12:41 AMVictor Harlan Lacson
06/12/2020, 9:12 AMdoyaaaaaaken
06/17/2020, 7:42 AMVictor Harlan Lacson
07/04/2020, 1:50 AMVictor Harlan Lacson
07/04/2020, 1:53 AMVictor Harlan Lacson
08/21/2020, 7:10 AMdoyaaaaaaken
08/22/2020, 2:50 AMfun readAll(data: String): List<List<String>>
And we should create new API like this.
fun<T> readAllWithType(data: String): List<T>
At first, we will support only for primitive types (not support java.time.*), attach @RequireOptIn annotation, and implement this method only (not implement readAllAsSequence
).doyaaaaaaken
08/25/2020, 8:41 AMLinks
section and introduce kotlin-grass.
https://github.com/doyaaaaaken/kotlin-csv/commit/8dbaa0742579f354cd973f230cf95dbad39f4263
Send me pull request to improve description about kotlin-grass.Phani Mahesh
10/02/2020, 3:03 PMdoyaaaaaaken
10/05/2020, 1:38 PMActually that won’t work because the stream is closed outside the lambda, and reading from sequence fails.Yes, this behavior is intended. As I said on [Principals section on README](https://github.com/doyaaaaaken/kotlin-csv#principals), file close is automatically done in this library. A file is open only inside
open
block.
The workaround is here.
I imagine your code is like this.
kotlin
suspend fun processRow(row: List<String>): List<String> {
return row.map { "prefix-$it" }
}
val rows: List<List<String>> = csvReader().open("test.csv") {
readAllAsSequence()
.map { row -> processRow(row) } // Compile ERROR!! processRow is suspend function so cannot call inside lambda
.toList()
}
In this example, you have some choices.
1. use blocking reader API `readAll` method
`val rows: List<List<String>> = csvReader().readAll("test.csv")`
2. enclose `processRow` method with `runBlocking`
I’ll look into it to see if it can improve.
Issue: https://github.com/doyaaaaaken/kotlin-csv/issues/66doyaaaaaaken
11/09/2020, 3:43 AMdoyaaaaaaken
08/30/2021, 12:52 PMthana
05/11/2022, 7:41 PM"
, use \
as escape character and `,`as delimiter, but have also escaped a comma inside the actual values which kotlin-csv refuses to parse... I'm eager to find what other nonsense is waiting for me...thana
05/13/2022, 7:13 AMdoyaaaaaaken
05/14/2022, 1:24 AMVictor Harlan Lacson
08/04/2023, 7:53 AMJun Sekine
08/10/2024, 12:45 PM