4 ms·
The painful part of all this is that there were and still are actual record separator and field separator characters in ASCII. ASCII was perfect for table outp
by lelanthran 3y ago
The painful part of all this is that there were and still are actual record separator and field separator characters in ASCII.
ASCII was perfect for table output. All tools had to do when outputting is use the standard existing characters when no TTY is detected, else use tabs/spaces and newlines.
I always wondered why no one uses the ASCII rs and FS codes.
- tpoacher 3y agoThat ... is an excellent question.
- nmz 3y agoHow would you deal with a tree?
- lelanthran 3y agoWho cares? It deals with 99.99% of uses cases that pipes are being used for right now. That's more than good enough. If you really needed to output a tree using only rs and fs characters, and since they are only a single byte each, you could cover that 1 in a 1000 use case by using empty fields for depth of a record, and attaching any record to the current parent until the depth changes.
- nmz 3y agoI care, I wrote a converter[1] for it a long time ago, when I wanted to write a json one I got stuck. Depth of a record seems useful, but then you'll have to make fields mandatory to indicate between real records and depth. slowing down the parsing. [1]: https://github.com/Nomarian/AsciiDT https://github.com/Nomarian/AsciiDT
- tejtm 3y agoNewick trees https://en.wikipedia.org/wiki/Newick_format https://en.wikipedia.org/wiki/Newick_format
- nmz 3y agoThat seems like a text format on its own? doesn't even use RS/FS. Even when Translating it uses { (),; } that's 4 characters to indicate a tree. Maybe you could use FS=, RS=; GS=( US=) Is that what you mean?