3 ms·
I recall one of my old Phones could dump SMS messages as CSV. I wanted to be build and interface that would let me search through my messages. Turns out when y
by the_only_law 5y ago
I recall one of my old Phones could dump SMS messages as CSV. I wanted to be build and interface that would let me search through my messages.
Turns out when you have data that contains both commas and quotes things get screwey real quick. You could have quoted data like:
123,ABC,”,””,456
Where ,” is column data.
I think that standard method is to double quote the field, but the dump sure wasn’t doing that for me, plus what happens when the data is something like abc””,?
- deleted 5y ago[deleted]
- rendall 5y ago> 123,ABC,”,””,456 That is badly formatted CSV, assuming ” is a double-quote. Double-quote (") is how you escape commas, so the 3rd entry will make a parser barf, since there is no close quote. It should be 123,ABC,"","",456 > Turns out when you have data that contains both commas and quotes things get screwey real quick. Not really. It's pretty logical. If the entry has even one comma, put quotes around it. If it also has quotes, double each of them. Otherwise don't worry about it. > what happens when the data is something like abc””,? abc"", becomes "abc"""","