Earlier quoted context omitted.
when running a command that's reading what you're typing to stdin, you press Ctrl-D to tell it that you're done. Because, as your "man ascii" trick shows, this generates the "end of transmission" character. This is slightly different than being able to actually generate those characters as input. If you put a control-d in a file, nothing will stop reading the file when it sees the control-d, it's just another byte. r…
Sure, the default is overridable, and the character has no magic effect when found in a binary file, but there's a reason Ctrl-D was chosen as the standard keystroke sequence to end a stdin transaction, and it has everything to do with the fact that "D" shows up next to "end of transmission" in `man ascii`.
ASCII Delimited Text – Not CSV or TAB delimited text
211–220 of 286 posts
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#212Earlier quoted context omitted.
Interesting web page! Despite many years of using ASCII and knowing some of the more common control codes, I had never even thought about what the other mysterious 0-31 codes were defined as. Something that the page doesn't mention is that CR+LF were originally two separate control codes because the action of returning the print head to the left hand side would take too long with a standard line printer. Therefore, s…
Depends on your platform. Even today a Unix/Linux line ending is almost always just LF. See: http://en.wikipedia.org/wiki/Newline
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.
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#2131. Replace all the commas in the text with the unique non-printing char before converting to CSV.
2. Convert this char back to a comma when processing the CSV for output to be read by humans.
Because commas in text are usually followed by a space, the CSV may still even be readable when using the non-printing char.
I must admit I've never understood why others view CSV as so troublesome vis-a-vis other popular formats.
in: sed 's/,/%2c/g' out: sed 's/%2c/,/g'
I guess I need someone to give me a really hairy dataset for me to understand the depth of the problem with CSV.
Meanwhile, I love CSV for its simplicity.
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#214Earlier quoted context omitted.
You're missing my point. If this were a "solved problem," then it would be no better than the status quo with TSV. Tabs are a similar kind of control character, except they can be typed and displayed easily. And TSV files are a mess because tabs end up in the fields themselves. It's a catch-22. (I'm exaggerating; this would still be somewhat better since there will never be a big key on your keyboard dedicated to the…
Tabs are not a record separator. They are a formatting code. That's why a mess is created when they are used to separate records.
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#215I've done this. Everybody hated it. Most text editors don't display anything useful with these characters (either hiding them altogether or showing a useless "uknown" placeholder), and spreadhseet tools don't support the record separator (although they all let you provide a custom entry separator so the "unit" separator can work). Besides the obvious problem that there's no easy way to type the darned things when som…
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#216Earlier quoted context omitted.
You can type them in console and vim with File separator - C-v C-\ Group separator - C-v C-5 Record separator - C-v C-6 Unit separator - C-v C-7 They are all visible characters in both vim and emacs by default. You can see them on the terminal with `cat -v` It would be nice if more tools were built to take advantage of these characters, but there are some that do.
In Emacs, one way to enter these characters is to use `M-x ucs-insert` and then enter the hex code of the separator: M-x ucs-insert 1c M-x ucs-insert 1d M-x ucs-insert 1e M-x ucs-insert 1f for file, group, record, and unit separators. Is there an easier way?
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#217Earlier quoted context omitted.
For CSV forbidding commas in data is not practical. For ASCII delimiters, forbidding ASCII delimiters in data is practical. Sure - you can't, say, nest ASCII tables into one another due to this limitation. But for simple structure, it doesn't hurt to have ASCII separators in the toolbox. The only big problem I see is that they're rendered as invisible characters, which will make debugging harder. If we wouldn't have…
If only they had included an official escape character in ascii ... oh wait
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#218Earlier quoted context omitted.
Sure, the default is overridable, and the character has no magic effect when found in a binary file, but there's a reason Ctrl-D was chosen as the standard keystroke sequence to end a stdin transaction, and it has everything to do with the fact that "D" shows up next to "end of transmission" in `man ascii`.
Thank you for clarifying something that no one was disputing or event mentioned.
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#219Earlier quoted context omitted.
Of those, |, @, #, ^, {, } and ~ are all keys that you need shift for on US Qwerty keyboards, so I imagine that the typing experience for those is relatively comparable.
IF those characters are actually displayed on the corresponding keys. If it's like the # on the Mac keyboard - not displayed anywhere - it's a right pain to learn in the first place without any visual cues.
(I do really miss the days when Mac keyboards had the weird symbol they use for "alt" in menus on the key.)
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#220Earlier quoted context omitted.
Here in Belgium we have to AltGr-the hell out of our keyboard during development. These characters can only be entered using the AltGr key on a Belgian Azerty keyboard (be-latin1): '|' '@' '#' '^' '{' '}' '[' ']' '\' and '~' Its not realy a problem, as long as you're used to it :-)
Of those, |, @, #, ^, {, } and ~ are all keys that you need shift for on US Qwerty keyboards, so I imagine that the typing experience for those is relatively comparable.
Must be annoying to have to press shift to get those symbol chars while you're coding, eh?