News for hackers. Stuff that matters.
Re:Earth-1217: where every CSV file has two header rows: col... by acheron on Sunday February 18, 2024 @06:10PM (#39424492)
If we’re imagining a parallel universe where things make sense, let’s get rid of CSV files altogether and use the ASCII field separator characters. https://en.wikipedia.org/wiki/C0_and_C1_control_codes#Field_...
Re:Earth-1217: where every CSV file has two header rows: col... by mjevans on Sunday February 18, 2024 @06:43PM (#39424731)
Is there any reason a 'csv' file can't use E.G.

\\002 2 0x02 STX (start of text)

OR

\036 30 0x1E RS (record separator)

as the record separator instead of a comma? The big reason CSV uses commas is to be human readable and editable, but otherwise...

Re:Earth-1217: where every CSV file has two header rows: col... by ot1138 on Sunday February 18, 2024 @07:32PM (#39425015)
Ha, we used to do this in the 90s with double pipes || and triple pipes |||.
Re:Earth-1217: where every CSV file has two header rows: col... by mjevans on Sunday February 18, 2024 @11:36PM (#39426261)
IIRC PHP BB used || for data separators. The abstraction often leaked.
Re:Earth-1217: where every CSV file has two header rows: col... by EvanAnderson on Sunday February 18, 2024 @06:14PM (#39424521)
Yes. I did a project ETL'ing data that used the ASCII field and record separators once. It was a joy to deal with compared to CSV.
Re:Earth-1217: where every CSV file has two header rows: col... by cpeterso on Sunday February 18, 2024 @07:24PM (#39424963)
This is definitely the Right Thing, but how well did other software, such as text editors, handle or render the field and record separator characters? That you can’t directly enter these characters on a keyboard would be a minor annoyance.
Re:Earth-1217: where every CSV file has two header rows: col... by EvanAnderson on Monday February 19, 2024 @12:01AM (#39426388)
The file I used was being generated by a partner company's ERP system so I didn't really have to make any files myself. Having said that, I use a lot of Notepad++ on Windows and using the ALT-029, ALT-028, etc, syntax generated the right codes for direct keyboard entry. They're displayed by Notepad++ as inverse text "RS", "GS", etc.