3 ms·
What's the problem with capital I?
by gpvos 2y ago
What's the problem with capital I?
- n_plus_1_acc 2y agoProbably referring to the "turkish i problem"
- gpvos 2y agoNot an unreasonable guess, but it turned out to be something different.
- IanCal 2y agoThe byte for a capital I is the same as the start for an odd file format, slyk maybe? Excel has (or did if they finally fixed it) for years decided this was enough to assume the file (called .csv) cannot possibly be csv but must actually be slyk. It then parses it as such, and is shocked to find your slyk file is totally broken!
- boogheta 2y agoIt sounds to me like as often the problem here is Excel, not CSV
- IanCal 2y agoClients don't particularly make the distinction, and in a way nor should they - they can't open your file.
- pasc1878 2y agoYes but in practice CSV is defined by what Excel does. As there is no standard to which Excel conforms as it predates standards and there would be an outcry if Excel started rejecting files that had worked for years.
- imtringued 2y agoThere is a common misconception here. You can import CSV files into an excel sheet. You cannot open a CSV file with excel. That is a nonsense operation.
- melagonster 2y agoExcel do not ask the user whether they want to import file, and tell user their file was broken.
- Someone 2y agohttps://superuser.com/questions/210027/why-does-excel-think-csv-files-are-sylk https://superuser.com/questions/210027/why-does-excel-think-... says itks not capital I but “ID”. Basically, Excel uses the equivalent of ‘file’ (https://man7.org/linux/man-pages/man1/file.1.html https://man7.org/linux/man-pages/man1/file.1.html), sees the magic “ID”, and decides a SYLK file, even though .csv files starting with “ID” have outnumbered .SYLK files by millions for decades.
- gpvos 2y agoThanks. So I guess the easy compatible solution is to always quote the first item on the first line when writing CSV. Good to know. (Checking if the item starts with ID is more work. Possibly quote all items on the first line for simplicity.) (Reading SYLK is obviously irrelevant, so accepting unquoted ID when reading is the smarter way to go and will actually improve compatibility with writers that are not Excel. Also it takes no work.)