Live data from Hacker News

CSV 1.1 – CSV Evolved (for Humans)

csv11.github.io

1–10 of 81 posts

Re: CSV 1.1 – CSV Evolved (for Humans)

#2
I can't see this gaining any traction. There's nothing wrong with CSV as it is for basic data transfer. CSV had been unchanged now for so long, that any attempt to update it will fail - there are simply too many CSV parsers already implemented.

If you are worried about people in the year 3000 understanding your data, add a .txt file alongside the CSV explaining the fields.

Re: CSV 1.1 – CSV Evolved (for Humans)

#6
I even don't see how it is better.

    ID,Name,Capital,Area,Tags
    bc,British Columbia,Victoria,922509,en|western canada
vs

    ###########################
    # Oh, Canada! 10 provinces and 3 territories
    #
    # see en.wikipedia.org/wiki/Provinces_and_territories_of_Canada
    #
    # note: key is two-letter canadian postal code
    #
    # for regions tags see
    #   en.wikipedia.org/wiki/List_of_regions_of_Canada

    bc, British Columbia,       Victoria,     922 509 km², en|western canada

In 1.1 I don't see what is what - what is `bc`? What is `en|western canada`? In vanilla CSV you can clearly see what is what because it shows you on top.

Why not just write a CSV formatter?

Re: CSV 1.1 – CSV Evolved (for Humans)

#7
Well, if you want to improve tabular data formats:

1. Add a version identifier / content-type on the first line!

2. Create a formal grammar for this CSV format

3. Specify preferred character-encoding

4. Provide some tooling (validation, CSV 1.1 => HTML, CSV => Excel)

5. Add the option to specify column type (string, int, date)

6. Specify ISO-8601 as the preferred date format

7. Allow 'reheading' the columns in the file itself. This is useful in streaming data.

8. Specify the format of the newlines.

Re: CSV 1.1 – CSV Evolved (for Humans)

#9

I even don't see how it is better. ID,Name,Capital,Area,Tags bc,British Columbia,Victoria,922509,en|western canada vs ########################### # Oh, Canada! 10 provinces and 3 territories # # see en.wikipedia.org/wiki/Provinces_and_territories_of_Canada # # note: key is two-letter canadian postal code # # for regions tags see # en.wikipedia.org/wiki/List_of_regions_of_Canada bc, British Columbia, Victoria, 922 509…

Right, where are the tag names specified? What if a new column is added, and my reader needs to handle both formats?

Also, seems like specification-by-example, unless I’m missing something.

Re: CSV 1.1 – CSV Evolved (for Humans)

#10
For those looking for a modern take on improving on the CSV format, I'd recommend Frictionless Data's Datapackage specification[1] which basically consists of a json file of metadata that accompanies a CSV file that describes column types, versions, sources, and how to validate correctness of the CSV's data. This allows for quite a lot of tooling and workflow improvements to CSV files without mucking with the CSV itself

Another hack to improve CSV workflows is OCHA's HXL[2] that is used by humanitarian organizations. Basically adding a row of hashtags in addition to column names, which is surprisingly useful considering the ease of adding these to a file.

[1] https://frictionlessdata.io/docs/tabular-data-package/ [2] http://hxlstandard.org/

Post reply on HN