Haha! Oh wow, I just finished a project dealing with this exactly. The obvious problem is that most editors make dealing with the non-standard keyboard keys very difficult. As a consequence, most programs (Python, MatLab, etc) really don't like anything below 0x20. I was reading in binary through a serial port, and then storing data for records and processing. Any special character got obliterated in the transfer to…
ASCII Delimited Text – Not CSV or TAB delimited text
61–70 of 286 posts
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#62The big problem with the two markers mentioned in the post is they are not part of the visible character set. Using a comma delimiter is good as it is visible, you can just use a basic text view to see it. A tab delimiter is not preferable as it is not visible, and can be problematic to parse via command line tools (ie what do I set as the delimiter character?). I think that is the whole point of having ASCII delimit…
C-v-shift-_ and C-v-shift-^ both work for me.
They print a little strangely, but if you were really dedicated to the idea, you could alias the tools you use to use these by default for their input and output separators.
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#63Re: ASCII Delimited Text – Not CSV or TAB delimited text
#64It's not often that the tab delimited format is problematic, at least nothing that a simple string-replace operation can't solve, so it's not worth trying to convince every existing text reader and text processors to recognize these long forgotten record separators correctly instead.
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#65This isn't some clever new discovery. It's begging us to repeat the same mistakes that led to the world adopting printable ASCII delimiters in the first place.
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#66Don't do this. Tsv has won this race, closely followed by Csv. Anything else will cause untold grief for you and fellow data scientists and programmers. I say this as someone who routinely parses 20gb text files, mostly Tsv's and occasionally Csv's for a living. The solution you are proposing is definitely superior but isn't going to get adopted soon.
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#67Don't do this. Tsv has won this race, closely followed by Csv. Anything else will cause untold grief for you and fellow data scientists and programmers. I say this as someone who routinely parses 20gb text files, mostly Tsv's and occasionally Csv's for a living. The solution you are proposing is definitely superior but isn't going to get adopted soon.
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#68Don't do this. Tsv has won this race, closely followed by Csv. Anything else will cause untold grief for you and fellow data scientists and programmers. I say this as someone who routinely parses 20gb text files, mostly Tsv's and occasionally Csv's for a living. The solution you are proposing is definitely superior but isn't going to get adopted soon.
TLDR: it's superior, but don't do it...
But now it's like harping on the benefits of HDDVD or Bluray.
Re: ASCII Delimited Text – Not CSV or TAB delimited text
#69Re: ASCII Delimited Text – Not CSV or TAB delimited text
#70The only trouble I ran into was that the library doesn't like getting rid of your quote character[1], and I don't see an easy way around it[2].
That said, I really don't like this format. The entire point of CSV is that you have a serialization of an object list that can be edited by hand. Sure using weird ASCII characters compresses it a bit because you're not putting quotes around everything, but if you're worried about compression you should be using another form of serialization - perhaps just gzip your csv or json.
In Ruby in particular, we have this wonderful module called Marshal[3] that serializes objects to and from bytes with the super handy:
serialized = Marshal.dump(data)
deserialized = Marshal.load(serialized)
deserialized == data # returns true
I cannot think of a single reason to use ASCII Delimited Text over Marshal serialization or CSV.1. ruby/1.9.1/csv.rb:2028:in `init_separators': :quote_char has to be a single character String (ArgumentError)