Earth-1217: where every CSV file has two header rows: column names and units
hachyderm.io
hachyderm.io
CSV is the universal file format, and will be forever; nothing else is ever as readable and as portable. You can’t easily get JSON out of an Excel sheet, or easily read it in any text editor.
CSV needs just a few tweaks to make it easier to avoid comma, double-quote, and newline issues that suck a bazillion dollars of productivity out of the economy each year with broken data imports.
This is probably the lowest hanging fruit in all of technology: a small change to Excel to dramatically improve data processing / import-export for all humanity.
Not quite related but I once saw a proposal that file formats should be regulated to require documented interoperability. This change would foster a ton of competition and evolve standards as an industry to the benefit to all is the argument in a nutshell.
If XLSX was documented for interop it would also go a long way in data independence
Some historical note: https://www.computerworld.com/article/2526864/microsoft-offe...
A good portion of those (whether it is "the majority", who can say) are actually between Excel and itself, e.g. two people in a company sending files to each other.
This is a multi-agent coordination problem. If Excel (the dominant market participant) makes a change because it is helpful to their own users anyway, that alters the incentive calculus for the other software products too. Suddenly there is a large enough market / population of users / number of integration events where making an investment in the enhancement makes sense.
Why would they want to pay for the reputation and credibility damage for the multi-year long, or multi-decade long, transition period?
\\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...
I've done this ever since NASA lost the Mars Climate Orbiter due to a unit conversion error.
https://en.wikipedia.org/wiki/Mars_Climate_Orbiter#Cause_of_...
I truly don't understand how and why people don't do this. Most people use pretty descriptive names now that every editor has autocomplete and big monitors are common. And yet, people never put the damn units in the identifier name. Would save so many bugs, and it would give engineers one less thing to juggle in their working memory.
That's quite a presumption
I think the rationale behind using CSV is even more basic. The reason why CSV is so popular (and TSV, HTML and JSON for that matter), is that it is a human readable format. It is much easier to troubleshoot and debug data and data flows if you can open a file and see it in an editor. Especially when trying to move data between systems/people/groups. You don’t really need to edit the file, just read and mentally parse it if there is a problem.
This is why the most popular formats are text based. It’s only when the verbosity of text is too great that we move to binary, such as for images and media (xpm excepted). For most other data, compression tends to be “good enough”.
Do they have a header? Is the data properly escaped? How are blank values at the end of the row handled? Etc, etc
Right, that's the point of a good library, to handle the ambiguities via insightful coding solutions, accumulated over decades - enough solutions to make it worth using the library. Other ambiguities can be handled with Q&A which result in automated solutions: 'the text looks like either X or Y, which is it?', and then disambiguating the text based on the answer.
Another benefit would be that, if the library became useful and widely used enough, it would become an unofficial standard: people would make CSV's compatible with the library and its output would become a norm.
All a happy fantasy! :)
Take a look at how Excel helpfully makes things dates or numbers, even when you don’t want them to be treated as such.
There’s no “insightful” way to understand that a column of numbers really wants to be treated like text or that 20-DEC-82 is a product code vs a date.
I would like a way to visually combine that with the tabular data while keeping the too distinct in the underling format such that:
- Constraints (e.g. type or format constraints) could be applied to the tabular data - The non-tabular data is free-form word processor style
It would also be be useful to be able to combine multiple tables with the same visual page.
In fact, this is why I asked — I’m actively working on an program which allows just this. In theory, it should be sufficiently flexible to allow for the kind of markup you mention… one more thing to look into!
This attitude in young programmers kills me. It's the old "let's make one tool that does everything, and i (re)invented it!" attitude they get after a few years on the job.
Instead of make something completely new that does everything expand the well known old by some useful features?
What a completely odd thing to say on a site like this, but alrighty.
Anyway, I'll be clear: I run a business that deals with CSVs and their oddities. I am acutely aware of how well they can work. This has nothing to do with the fact that most programmers I've met, given the choice, would prefer literally any other data format.
Small specs that don't define very much have a value. Least common denominators have a value.
It's a problem to use the basic solution in an enterprise problem, but it's also a problem to use the enterprise solution to trivial problems.
You are expressing your view, I am expressing mine, that is all.
I am not commenting on some ill-fated attempt to add types to CSV columns.
Edit: removed a "not" in the wrong place.
The subtle bit is most languages & these formats have data representation (int16, ..) but not actual unit (GB/s) and oh boy....
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;Stylistically, I suggest using a colon like many programming languages do for type annotations:
Name:string,Qty:unitsEither would make my day as a programmer though.
You just know that someone somewhere will do just that and you'll have to deal with it as best you can.