Anyone that's ever had to parse arbitrary data knows of the approximately 14 jiggityzillion corner cases involved when sucking in or outputting CSV/TAB delimited formats. Yet much like virtual memory and virtual machines, we find that a solution has existed since the 60s. For those wondering about the history and use of all those strange characters in your ASCII table: http://www.lammertbies.nl/comm/info/ascii-charac…
> One might question why all control codes in the ASCII character set have low values, but the DEL control code has value 127. This is, because this specific character was defined for deleting data on paper tapes. Most paper tapes in that time used 7 holes to code the data. The value 127 represents a binary pattern were all seven bits are high, so when using the DEL character on an existing paper tape, all holes are…
ASCII Delimited Text – Not CSV or TAB delimited text
281–286 of 286 posts
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#282Earlier quoted context omitted.
Back in the day with a numeric keypad you could type Alt-(number) to get any ASCII character, but not sure if that still works. In Firefox apparently Alt-1 takes you to the first tab, Alt-2 second tab...
In most graphical *nix environments that I'm familiar with, if you hold Control and Shift¹ and type U, you can type any Unicode character by its (hex) code point. For instance, if you want an em dash, which is U+2014, hold Control and Shift, and type "U2014". ¹You can release Control and Shift after typing "U", in which case the character will appear after you type a space. Or, you can hold Control and Shift while ty…
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#283Earlier quoted context omitted.
Unix = LF Mac = CR DOS = CRLF The DOS line endings are inherited from previous systems, and while they precisely convey carriage and paper movement of a printer it can be a pain to deal with today.
Only old Macs. They switched to POSIX-style LF with OS X.
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#284Earlier quoted context omitted.
Perhaps, but I think it still goes against the original intent. Ctrl-~ or Ctrl-^ should give you a record separator (RS) and Ctrl-Del or Ctrl-_ should give you a unit separator (US). For the same reason Ctrl-m or Ctrl-M should give you carriage return (CR). This is because ASCII values from 00-1F are control characters and effectively grounded the most significant bits 7 and 6. Shift similarly would toggle or ground…
This hasn't been true since IBM keyboards became popular. For example, on older keyboards shift+number would simply toggle a bit, so shift+2 would be a double quote, etc., but this hasn't been common for decades now. Unfortunately.
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#285Earlier quoted context omitted.
Examples of length-prefixed data abound in protocols and formats defined by systems and telecom engineers (e.g. the IETF). IP packets are length-prefixed. ELF-binary tables and sections are length-prefixed. PNG chunks are length-prefixed. It's just these worse-is-better text-based protocols like HTTP, created by application developers, that toss all the advantages of length-prefixing away. (And, even then, HTTP bodie…
The only problem with length prefixing is that it interferes with streaming data, because you need to know the full length in advance. Thus HTTP chunked encoding. Still, it works great in most scenarios. My favorite way to deal with this stuff is Consistent Overhead Byte Stuffing: http://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffi... In short, you take the data and encode it with a clever scheme that effect…
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#286Earlier quoted context omitted.
> It may as well be XML (i.e. technically text-based but not practically human-readable). Is this really a standard complaint about XML? I thought the main complaint was that it wasn't human- writeable . I wouldn't want to read novels in XML, but I've never had a problem opening up an XML file in a text editor to get at bits of it.
Well, you'll often get XML files with a single line and no whitespace between elements, and that makes things a lot more interesting. Basically, you can't rely it being practical to quickly poke around in the text of an XML file. I always feel sad when I have to read the text of an XML file to get information.
That can be fixed with `xmllint --format`; but I agree that, once you need to bring in external tools, it's not clear that calling it 'human-readable' is really appropriate any more.