2 ms·
If only ASCII had a field separator character, then we could just use that instead.
by aidenn0 2y ago
If only ASCII had a field separator character, then we could just use that instead.
- LargoLasskhyfv 2y agoNot sure if satire, or not. Just in case of not: https://en.wikipedia.org/wiki/ASCII#Character_groups https://en.wikipedia.org/wiki/ASCII#Character_groups https://en.wikipedia.org/wiki/C0_and_C1_control_codes#C0_controls https://en.wikipedia.org/wiki/C0_and_C1_control_codes#C0_con...
- 1vuio0pswjnm7 2y agoNow sure about "we" but I have used these for years in personal projects for own purposes. Dec Octal Hex Binary 028 034 01C 00011100 FS (File Separator) 029 035 01D 00011101 GS (Group Separator) 030 036 01E 00011110 RS (Request to Send)(Record Separator) 031 037 01F 00011111 US (Unit Separator)
- ctenb 2y agoWhat software did you use to write that, and how did other dev tools behave with these characters? Just curious
- 1vuio0pswjnm7 2y ago1. tcpclient, yy025 (a program I wrote that generates HTTP), sed, cut, paste, nvi or vim 4.6 if I need to edit, depending on whether I'm using NetBSD or Linux; formatted text is copied and pasted using tmux buffers since I do not use X11 For example program|sed or grep|tmux loadb /dev/stdin where program is a script that outputs a custom ASCII table 2. The UNIX software I'm using works with these characters The idiom I use for inserting the FS character via command line or shell script is x=$(echo x|tr x '\34') For example, echo select \* from t1|sqlite3 -separator $x 0.db > 0.fsv "To import data with arbitrary delimiters and no quoting, first set ascii mode (".mode ascii"), then set the field and record delimiters using the ".separator" command. This will suppress dequoting. Upon ".import", the data will be split into fields and records according to the delimiters so specified."^1 But I use tr. tr '\34' , < 0.fsv > 0.csv If there is a risk that field values might contain the FS character, then I delete or replace that character in the data before I create fields. For example, sed -i "s/$x//g" data sed -i "s/$x/FS/g" data 1. https://sqlite.org/cli.html https://sqlite.org/cli.html
- 1vuio0pswjnm7 2y agoNote to self: This originally got an up.
- mbirth 2y agoAlso, news transmissions from agencies to newspapers or TV stations used (maybe still use in some places) a format called IPTC 7901 which also makes use of the SOH, SOT, EOT and EOH codes: https://www.iptc.org/std/IPTC7901/1.0/specification/7901V5.pdf https://www.iptc.org/std/IPTC7901/1.0/specification/7901V5.p... This stems from them coming via a serial wire (which is why news updates are also called “wires” in that context) to a TTY. (Nowadays, you’d have a server receiving everything over the Internet and spitting it out in this format via a serial port or Telnet connection if needed.) According to Wikipedia, fancier news messages are possible using some more codes, but I’ve never seen them in the wild in recent years: https://en.wikipedia.org/wiki/IPTC_7901#C0_control_codes https://en.wikipedia.org/wiki/IPTC_7901#C0_control_codes