Hacker News new | past | comments | ask | show | jobs | submit login

> where every CSV file has two header rows

sigh

Why people always try to make it harder?

    Name,string;Qty,units;Weight,kg;Volume,m^3;Just for the sake of it with spaces,string;No don't use comma in the header names - it doesn't make sense,string;



Why not do it the other way? Name;string,Qty;units so that if you just double click to open in excel, or use a naive reader that doesn't understand the format (which most won't), the column names are basically correct?


That’s a great idea and useful fallback behavior for file importers that don’t understand the type annotations.

Stylistically, I suggest using a colon like many programming languages do for type annotations:

  Name:string,Qty:units


I think it has more to do with Excel properly recognizing the data type rather than humans doing so. It has been too long since I dealt with it to recall the troubles but I know there are things that should be easy that aren't since you can't tell Excel how to interpret the data.


In the fictional world where excel understands the second header row, it could just as easily understand a unit delimiter and units in a single header row.

Either would make my day as a programmer though.


> No don't use comma in the header names

You just know that someone somewhere will do just that and you'll have to deal with it as best you can.


Even a newline could be used per header to add a second 'line' that has the units. It makes sense to humans and computers could easily read that.


But this will break all of my unquoted columns with semicolons in them!


SSV?




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: