Re:So you want to write your own CSV code (2014)
by snazz on Friday May 15, 2020 @08:54AM
(#23191590)
The TSV (tab-separated values) format is supported by a lot of software (Google Sheets, for instance) and solves the "comma in the field" problem quite nicely. Tabs can easily be typed by a human, but they don't usually occur within a one-line string, so they don't cause the same problems as CSVs do.
[ Parent
| on HN ]
Re:So you want to write your own CSV code (2014)
by hulahoof on Friday May 15, 2020 @10:30AM
(#23192583)
TSV, CSV, PSV etc. all share the same class of problem. The important thing is that you are quoting your fields and escaping your quotes, regardless of the symbols used.
Re:So you want to write your own CSV code (2014)
by JoBrad on Friday May 15, 2020 @11:02AM
(#23192961)
Importantly, tabs aren’t usually inserted into fields by Excel users. With Power BI, exporting TSV is a little easier for non-dev Excel power users, too.
Re:So you want to write your own CSV code (2014)
by IggleSniggle on Friday May 15, 2020 @12:32PM
(#23194081)
Nailed it. When Excel users press tab, they mean "go to the next cell." Conveniently, this is also what the format means to the computer when it encounters the tab separator. It's not foolproof, but it's much better. The human interpretation of the character matches the machine interpretation.
Re:So you want to write your own CSV code (2014)
by DataWorker on Friday May 15, 2020 @02:06PM
(#23195320)
“Don’t usually occur”
They do. People write code to create all sorts of bastardized abominations of “csv” or tab delim or whatever. It’s why the featured article gets reposted every few years. You can define a standard for csv files, but then Excel does it’s own thing and here we are.