https://kotlinlang.org logo
Join SlackCommunities
Powered by
# kotlin-csv
  • d

    doyaaaaaaken

    08/23/2019, 11:37 AM
    set the channel description: https://github.com/doyaaaaaken/kotlin-csv
  • d

    doyaaaaaaken

    08/23/2019, 11:52 AM
    set the channel topic: https://github.com/doyaaaaaken/kotlin-csv
  • v

    Victor Harlan Lacson

    05/22/2020, 10:10 AM
    Hello Kenta, About the issue #40 I look the implementation of
    readAllWithHeader(): List<Map<String, String>>
    it was initially as a sequence then converted to list. so I guess the implementation is already covered.
  • d

    doyaaaaaaken

    05/22/2020, 2:10 PM
    @Victor Harlan Lacson You are right! The solution is quite simple as you said. https://github.com/doyaaaaaken/kotlin-csv/pull/43#discussion_r429269076
  • d

    doyaaaaaaken

    05/24/2020, 10:15 PM
    version 0.9.0 released 🚀 https://github.com/doyaaaaaken/kotlin-csv/releases/tag/0.9.0
  • d

    doyaaaaaaken

    05/31/2020, 2:08 PM
    version 0.10.0 is released now. Thanks again to @Victor Harlan Lacson https://github.com/doyaaaaaken/kotlin-csv/releases/tag/0.10.0
  • d

    doyaaaaaaken

    06/01/2020, 12:44 PM
    @Victor Harlan Lacson By the way, commits which are made by
    Victor Harlan D. Lacson
    are not shown on contributors page. I slightly recommend to make commits connected with your acount.
    • 1
    • 2
  • d

    doyaaaaaaken

    06/01/2020, 2:24 PM
    version 0.10.1 is out 🚀 https://github.com/doyaaaaaken/kotlin-csv/releases/tag/0.10.1
  • d

    doyaaaaaaken

    06/09/2020, 12:41 AM
    Released 0.10.4 for bug fix. (0.10.2 and 0.10.3 are skipped from my mistake) Thanks for reporting bug. https://github.com/doyaaaaaken/kotlin-csv/releases/tag/0.10.4
  • v

    Victor Harlan Lacson

    06/12/2020, 9:12 AM
    Hello Kenta, I like to ask permission to feature(put link) kotlin-csv on my project will be posted on github soon. I dont have plan to set it as library within the projects since most of the setting is done within kotlin-csv, but rather make it work in tandem with kotlin-csv Im planning to create a project parsing csv file into a kotlin data class without any annotations, tho my prototype is already working. if it goes all is well maybe you could feature my work too. 😅
  • d

    doyaaaaaaken

    06/17/2020, 7:42 AM
    Cool 👍 Of course, you need no permission by me! I hope you make a good library!
  • v

    Victor Harlan Lacson

    07/04/2020, 1:50 AM
    I created this a while a go. thanks to your kotlin-csv https://github.com/blackmo18/kotlin-grass
    👏 1
    ⭐ 1
    t
    • 2
    • 3
  • v

    Victor Harlan Lacson

    07/04/2020, 1:53 AM
    I tried to implement node-js target on kotlin-csv writer. it works fine, but cant create a good test, since the nature of node to be asynchronous, the test is executed even the writing is not finished yet thus it fails
  • v

    Victor Harlan Lacson

    08/21/2020, 7:10 AM
    Hello @doyaaaaaaken I saw the notification for fo issue #21. I think I its the same as what i have published using kotlin-csv itself. Although I am intrigue for other implementation and approach you may have in mind. I would to contribute.
  • d

    doyaaaaaaken

    08/22/2020, 2:50 AM
    Thanks @Victor Harlan Lacson Exactly, kotlin-grass is near with my image. If you would implement, I’ll appreciate it. My API design image is here. Current API design is below.
    fun 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
    ).
    v
    • 2
    • 3
  • d

    doyaaaaaaken

    08/25/2020, 8:41 AM
    @Victor Harlan Lacson Create
    Links
    section and introduce kotlin-grass. https://github.com/doyaaaaaken/kotlin-csv/commit/8dbaa0742579f354cd973f230cf95dbad39f4263 Send me pull request to improve description about kotlin-grass.
  • p

    Phani Mahesh

    10/02/2020, 3:03 PM
    Hey can anyone help with this: Any opinions? https://kotlinlang.slack.com/archives/C0922A726/p1601649299295100
    d
    • 2
    • 1
  • d

    doyaaaaaaken

    10/05/2020, 1:38 PM
    Sorry for the late reply, and very thanks for useful feedback @Phani Mahesh
    Actually 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.
    Copy code
    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.
    Copy code
    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/66
  • d

    doyaaaaaaken

    11/09/2020, 3:43 AM
    v0.13.0 is out 🚀 https://github.com/doyaaaaaken/kotlin-csv/releases/tag/0.13.0
  • d

    doyaaaaaaken

    08/30/2021, 12:52 PM
    v1.0.0 is out 🚀 Support Kotlin/JS https://github.com/doyaaaaaken/kotlin-csv/releases/tag/1.0.0
  • t

    thana

    05/11/2022, 7:41 PM
    Hi! Might there be any chance I can use this wonderful library to parse somewhat broken csv? They seem to have quoted all fields with
    "
    , 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...
  • t

    thana

    05/13/2022, 7:13 AM
    i ended up using jackson-csv 🤷‍♀️
  • d

    doyaaaaaaken

    05/14/2022, 1:24 AM
    @thana Thanks for the question! Unfortunately, kotlin-csv cannot read broken CSV. 🙏
  • v

    Victor Harlan Lacson

    08/04/2023, 7:53 AM
    Hi, @doyaaaaaaken. can we support a mechanism for example invalid row, we can pipe some interface so it can listen into it without throwing an error and stop the process middle way, in this manner we can keep track what failed what.
    d
    • 2
    • 3
  • j

    Jun Sekine

    08/10/2024, 12:45 PM
    Hello, I wanted to inform you that the ownership of the kotlin-csv project has been transferred from @doyaaaaaaken to @jsoizo (me). At the moment, only the GitHub repository ownership has changed, but please note that the package namespace and Maven Central repository will also be updated in the near future. Thank you for your continued support and understanding.
    👍 1