Giter Site home page Giter Site logo

Comments (8)

doyaaaaaken avatar doyaaaaaken commented on July 19, 2024 1

The "CSV" definition is defined on RFC4180.
It says here.

Within the header and each record, there may be one or more fields, separated by commas. Each line should contain the same number of fields throughout the file.

So, your sample code doesn't write "CSV" file, so it's not unnatural that kotlin-csv cannot read your writing file.

from kotlin-csv.

koral-- avatar koral-- commented on July 19, 2024 1

OK, thanks. Now I understand the explanation.
One little question then: is it intended that library allows writing a file which does not conform to CSV format?
In this particular case the 2nd #writeRow() call may throw an exception (or it can be thrown when closing file, technical details are not important now).

from kotlin-csv.

doyaaaaaken avatar doyaaaaaken commented on July 19, 2024 1

Yeah, right. Thank you.
Maybe, it'd be better to create another issue, relate this issue on that, and close this issue.

from kotlin-csv.

doyaaaaaken avatar doyaaaaaken commented on July 19, 2024

@koral--
Thanks for reporting!

Throwing exception is expected behavior.
If you change behavior, the skipEmptyLine option on CsvReader is available.
See https://github.com/doyaaaaaken/kotlin-csv#customize

from kotlin-csv.

doyaaaaaken avatar doyaaaaaken commented on July 19, 2024

Any other question on this topic? Feel free to ask.
If not, I'll close this issue.

from kotlin-csv.

koral-- avatar koral-- commented on July 19, 2024

I don't longer need this library, but can help resolve this issue if needed.

I don't understand your explanation. Could you elaborate?
Is it really intended that CSV written by this library is not readable by itself?

from kotlin-csv.

doyaaaaaken avatar doyaaaaaken commented on July 19, 2024

One little question then: is it intended that library allows writing a file which does not conform to CSV format?

Yes, it's intended.

In this particular case the 2nd #writeRow() call may throw an exception (or it can be thrown when closing file, technical details are not important now).

Yes, it should be. To throw exception on the 2nd writeRow() call is useful.
At this point, I don't plan to implement this validation by myself, but pull requests are welcomed. 👍

from kotlin-csv.

koral-- avatar koral-- commented on July 19, 2024

OK so I guess that this issue can be rephrased to something like "Fail fast on writing malformed CSV" and tagged as enhancement., right?

from kotlin-csv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.