Hacker News new | ask | show | jobs
by thbb123 691 days ago
Sad that the ASCII specification includes 2 codes: 30 and 31, respectively field separator and record separator, precisely to answer cleanly the need that CSV fullfils addresses.

During the 90's I was anal for using them, pissing the hell out of my teammates and users for forcing them to use these 'standard compliant' files.

Had to give up.

5 comments

They're hard to type though. You need to teach people how to use those -vs- just using a comma.
And they still don't fix the escaping problem. You might as well use a niche utf8 emoji as a separator. Editors at least know how to consistently render an emoji.
Does your data include ascii 30 and 31?

As a co-op student I used a library to achieve fool proof encoding in csv so it escaped and quoted everything as necessary so commas,\, and quotes and any other character could be included in the data, but it was rejected since the plain text files were difficult to read and edit by hand!

One typical scenario is to embed a CSV (or whatever it is called) into another one.
Hilariously I have actually seen this done.
Which emoji was it? Scissors?
Nah nothing funny like that, just a shape I think blue circle.
The ease of typing a character should only matter for artisanal, hand-typed files.
I agree. So if we don't need this hand crafted and for human consumption, we may as well just use some TLV or LV encoding instead of the CSV madness of separators and escaping. CSV is basically designed for hand crafting.
They are also easy to read, perhaps easier than a 'space' or other character. Although this could be because we are just used to seeing data eg CSV in this way
What do you mean comma? csv uses tabs. /s
Technically that is a TSV file. :)
A valuable lesson in user experience triumphing over pedantic correctness.
a lesson in confusing representation and data. if users can learn not to edit xls in text editor and to "go to next cell" type "tab" in spreadsheet software, they can learn edit csv in a proper csv editor. the only trap was that we made a non-text format so simple that tricked ourself that "it's only plain text".
Sqlite still supports it: .mode ascii
I've recently learned about them and an trying to revive usage - .asv and .usv files.

The .usv separators make things easier to read at the expense of a bit more space.

Main point for me making the parsing so much simpler.

Who writes .csv files by hand anyway?

Editing csv by hand is something I’ve seen a lot for internal-only software where every user is a super-power user who need to move small but bulk amounts of data and sometimes make small edits for formatting.

Easiest example is geo, I need 20 states listed as US-CO, US-CA, etc but one tool exported as US CO.

Standards-compliance and using esoteric features over catering for the realities of usability. Your coworkers were right to steamroll you.
If these ASCII code points were actively used, the support in common editors that are used for editing CSV files would become much better very fast.