Comments (8)
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.
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.
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.
@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.
Any other question on this topic? Feel free to ask.
If not, I'll close this issue.
from kotlin-csv.
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.
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.
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)
- Make CsvFileReader.readNext() private HOT 6
- Keep input stream open HOT 2
- Optimize writeNext Method HOT 3
- The binary version of its metadata is 1.6.0, expected version is 1.4.2.
- Seeing a parsing error when quotes within text HOT 1
- Parser unable to parse csv file with lower row quantity compare with header HOT 6
- Introduce `insufficientFieldsRowBehaviour = "EMPTY_STRING"` option on CSV reader HOT 2
- How to read big csv file using your library?
- CsvFileWriter.writeRows writes line terminator even when passed list or sequence is empty HOT 3
- Allow an error interface channnel HOT 1
- Unable to parse with multiple quotes HOT 1
- number of fields in a row has to be based on the header HOT 3
- Introduce BOM for Microsoft applications HOT 10
- Is there a way to alter existing csv file columns while reading from it? HOT 1
- Handle duplicated headers HOT 2
- kotlin-csv.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.16. HOT 1
- Remove logger 3rd party library HOT 8
- java.lang.NoClassDefFoundError: com/github/doyaaaaaken/kotlincsv/dsl/CsvReaderDslKt HOT 1
- How to set/get Header HOT 1
- Write directly to a String HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kotlin-csv.