5 ms·
“Any file is a database if you awk hard enough.” —Bryan Horstmann-Allen https://twitter.com/neilkod/status/914217352564137984 https://twitter.com/neilkod/stat
by rudolfwinestock 8y ago
“Any file is a database if you awk hard enough.” —Bryan Horstmann-Allen
https://twitter.com/neilkod/status/914217352564137984 https://twitter.com/neilkod/status/914217352564137984
Furthermore, no thread on CSV files can be complete without mentioning this infamous bit of fact-trolling: the ASCII standard has had unit- and record-delimiters baked into it from the beginning.
https://ronaldduncan.wordpress.com/2009/10/31/text-file-formats-ascii-delimited-text-not-csv-or-tab-delimited-text/ https://ronaldduncan.wordpress.com/2009/10/31/text-file-form...
- brianm 8y agoAbility to eyeball it on terminal is huge though :-( Never underestimate ergonomics like screen printability!
- gdfasfklshg4 8y agoIf people used them then the characters would almost certainly be represented in terminals as table spacing characters...
- bhengaij 8y agoAnd they're literally named thus too. US, FS. We just need an rcat to print them clearly.
- z92 8y agoUsability suffers, if you can't type the delimiters easily.
- hyperbovine 8y agoI can’t stand it when I’m banging out a CSV by hand and have to manually escape the field and record separators. Happens all the time.
- z92 8y agoI use TSV for that reason. Most of the time you don't need to escape anything. And from code you need to escape/unescape only 4 chars. \t \n \NULL and \\.
- dghf 8y agoIn a terminal, Record Separator is CTRL-^, Unit Separator is CTRL-_. Vi[m] will accept the former literally, and will accept the latter if escaped with a CTRL-V.
- rusk 8y ago> the ASCII standard has had unit- and record-delimiters baked into it from the beginning. That's mad that I've never heard of that before. I'm amazed this isn't used more often!
- stouset 8y agoThey don’t really get used IMO because if you’re storing ASCII or Unicode text, you have to be prepared for those characters to be in your data. And if you’re storing binary data, delimiters don’t really cut it in the first place.
- marcodave 8y agoalso they cannot be found in keyboards, if you need to write CSV by hand
- romdev 8y agoCan't be found, but you can enter them by hand by holding down alt while entering the ASCII code on the numeric keypad. I wonder if they'll survive posting a comment: 28∟ 29↔ 30▲ 31▼ Edit: looks like they do survive. Hmmm... Now I wonder about extended ASCII. └┐│└└╚╦╝
- dapithor 8y agoAlso, you can leverage the ISO/IEC 2022 extension and represent them with Caret Notation. Note: recommend an escaping mechanism depending on data. REF: https://en.wikipedia.org/wiki/C0_and_C1_control_codes#C0_(ASCII_and_derivatives) https://en.wikipedia.org/wiki/C0_and_C1_control_codes#C0_(AS... An editor such as vim or pager like 'less' will display them. You can also 'cat -v' a file.
- fulafel 8y agoYou can type it at a terminal the same way you can write other low-ascii codes. For example record separator, 30, is ctrl-^ - you can type it in the terminal by the usual literal control char way, ctrl-v[1]. So for example at a Python prompt: >>> ord('^^') # typed ctrl-v ctrl-^ here 30 (the low unprintable ascii codes correspond to certain ctrl combinations because ctrl-x is just the ascii code of x with the high bits masked off (i.e. & 0x1f) ) [1] custimizable in your terminal settings, see stty lnext ("literal next")
- enriquto 8y agooh, I love that! I'm going to use these delimiters from now on.