You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
After reading the CSV specification on csv-spec.org, I have 2 questions:
What should happen when an empty file is converted from CSV to JSON? Should there be an error message telling the user that you cannot convert an empty file, should the program just create an empty list or does something else need to happen?
In clause 3 is stated:
There may be an OPTIONAL header line appearing as the first line of the file with the same format as normal records.
And in the example it gets convert in the following way:
But what if a CSV file only has one line, for example the field_1,field_2,field_3 line. Because the header is optional, there is no problem when the file is interpreted without a header, but if the user/program says that the file should have a header, than there are no values for those headers. In this example, there wouldn't be a value aaa or xxx to give to the header field_1, making it so the header doesn't exist in the program and that there is no data loaded from the file. Should these headers than only be used when the program wants to add data to an existing header? Or should there be an error / something else?
I don't think these questions are answered in the specification, but my apologies if I looked over them.
Thank you.
The text was updated successfully, but these errors were encountered:
Hello,
After reading the CSV specification on csv-spec.org, I have 2 questions:
What should happen when an empty file is converted from CSV to JSON? Should there be an error message telling the user that you cannot convert an empty file, should the program just create an empty list or does something else need to happen?
In clause 3 is stated:
And in the example it gets convert in the following way:
But what if a CSV file only has one line, for example the
field_1,field_2,field_3
line. Because the header is optional, there is no problem when the file is interpreted without a header, but if the user/program says that the file should have a header, than there are no values for those headers. In this example, there wouldn't be a valueaaa
orxxx
to give to the headerfield_1
, making it so the header doesn't exist in the program and that there is no data loaded from the file. Should these headers than only be used when the program wants to add data to an existing header? Or should there be an error / something else?I don't think these questions are answered in the specification, but my apologies if I looked over them.
Thank you.
The text was updated successfully, but these errors were encountered: