▲ 562 ▼ Just the way we likes it. (mander.xyz) submitted 7 months ago by fossilesque@mander.xyz to c/science_memes@mander.xyz 22 comments fedilink hide all child comments
[–] espurr@sopuli.xyz 3 points 7 months ago (5 children) What delimiter should I be using instead of commas? permalink fedilink source parent hideshow 5 child comments replies: [–] rustydrd@sh.itjust.works 12 points 7 months ago 🤪 as a delimiter 🥦 for end of line permalink fedilink source parent [–] emergencyfood@sh.itjust.works 5 points 7 months ago Use comma for delimiter, and escape any comma in the data by enclosing that entry in quotes. Data: 225 | 2,500 | 450 CSV: 225,"2,500",450 permalink fedilink source parent [–] Jason2357@lemmy.ca 1 point 7 months ago (1 child) The delimiter isn't really the issue. Its that there are lots and lots of weird edge cases that break reading csvs. If you use commas, at minimum, you need to escape commas in the data, or quote strings that might contain commas... But now you have to deal with the possibility of a quote character or your escape character in the data. Then you have the fact that csvs can be written with so many different character encodings, mangling special characters where they occur. Aaand then you have all the issues that come with lack of metadata - good formats will at least tell you the type of data in each column so you dont have to guess them. Lets see, its also really annoying to include any binary data in a csv, theres no redundancy or parity checks to catch currupted data, and they arent compressed so you need to tack on compression if you want efficient storage, but that means you always have to read the whole csv file for any task. Oh, that brings me to the joys of modern columnar formats where you can read selected columns super fast without reading the whole file. Oh god, I really kept going there. Sorry. Its been a year. permalink fedilink source parent hideshow 1 child comment replies: [–] espurr@sopuli.xyz 1 point 7 months ago No that was really cool, what's an exaple of modern format? CSV sounds kinda not based permalink fedilink source parent [–] I_am_10_squirrels@beehaw.org 1 point 7 months ago Alt-008 permalink fedilink source parent
[–] rustydrd@sh.itjust.works 12 points 7 months ago 🤪 as a delimiter 🥦 for end of line permalink fedilink source parent
[–] emergencyfood@sh.itjust.works 5 points 7 months ago Use comma for delimiter, and escape any comma in the data by enclosing that entry in quotes. Data: 225 | 2,500 | 450 CSV: 225,"2,500",450 permalink fedilink source parent
[–] Jason2357@lemmy.ca 1 point 7 months ago (1 child) The delimiter isn't really the issue. Its that there are lots and lots of weird edge cases that break reading csvs. If you use commas, at minimum, you need to escape commas in the data, or quote strings that might contain commas... But now you have to deal with the possibility of a quote character or your escape character in the data. Then you have the fact that csvs can be written with so many different character encodings, mangling special characters where they occur. Aaand then you have all the issues that come with lack of metadata - good formats will at least tell you the type of data in each column so you dont have to guess them. Lets see, its also really annoying to include any binary data in a csv, theres no redundancy or parity checks to catch currupted data, and they arent compressed so you need to tack on compression if you want efficient storage, but that means you always have to read the whole csv file for any task. Oh, that brings me to the joys of modern columnar formats where you can read selected columns super fast without reading the whole file. Oh god, I really kept going there. Sorry. Its been a year. permalink fedilink source parent hideshow 1 child comment replies: [–] espurr@sopuli.xyz 1 point 7 months ago No that was really cool, what's an exaple of modern format? CSV sounds kinda not based permalink fedilink source parent
[–] espurr@sopuli.xyz 1 point 7 months ago No that was really cool, what's an exaple of modern format? CSV sounds kinda not based permalink fedilink source parent