|
I'll stick with CSV; it's so much more compact than anything else. With a header row, it conveys everything that a JSON would.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
until you have to nest data. I've done that with CSV and SQL tables though, it's just not pretty.
Also with CSV you need a way to handle commas, and there's nothing standard, AFAIK - really that's the biggest sticking point for me because that makes the grammar ambiguous
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Quote: until you have to nest data. I've done that with CSV and SQL tables though, it's just not pretty.
I agree with that, so I save JSON for when I really need it. In that case, it beats the pants off its predecessor, XML.
Quote: Also with CSV you need a way to handle commas, and there's nothing standard, AFAIK - really that's the biggest sticking point for me because that makes the grammar ambiguous
That's easy: guard characters, which are a well-established industry practice, which is fully implemented by my AnyCSV library.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
but they aren't always the same, no?
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Quote: but they aren't always the same, no?
What aren't always the same? If you mean the label row and the data, they must match, of course.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
oh yeah. now i know what you mean by guard chars
sorry, it's been ages since i've seen that.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Quote: oh yeah. now i know what you mean by guard chars
That is fair enough since I coined the term.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
i don't do enough CSV apparently, because i forgot about that technique tho
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I use them regularly; I've even embedded them into .NET assemblies as resources that I read into memory streams and use WizardWrx.AnyCSV.dll to parse.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
CSV doesn't make me happy.
As I'm living an the much larger part of the world where the standard decimal separator happen to be a comma, CSV tends to create a displeasure in previously mentioned posterior.
|
|
|
|
|
|
I'm happily ignorant as to what that is.
|
|
|
|
|
and better to continue so
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
If it makes you feel better, I never trusted them in the business end of things precisely because of the comma.
but for debugging state tables it works like a charm - no globalization/localization required. no funny currency markers munging up the input.
i hear you though.
I tend to JSON usually. Historically I've only provided export/import to/from CSV if a client requests it explicitly. It's a godawful format.
The thing is, i just like finding a use for it that isn't evil.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
JSON, XML or TDV (Tab Delimited Values) usually works equally fine for me. But I try to make it a habit to avoid formats that might create bugs in the future.
|
|
|
|
|
When I think of CSV, I am usually referring to any character-delimited text, of which the comma ranks well down on the list of preferred delimiter characters. I much prefer the vertical bar, "|" ASCII code 0x7c, or the TAB character, ASCII code 0x09.
1) The advantage of the vertical bar that it almost never occurs in normal text.
2) The advantage of the tab is that it is trivially easy to export well-formed rows (lines) of tab-separated values from many databases and accounting applications, and they are the default import delimiter in Microsoft Excel.
I emphasized the import delimiter in connection with Excel to differentiate it from opening CSV files into Excel, since opening a CSV bypasses the import wizard, with frequently unwanted, if not outright distastrous, results.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
your point is taken, though for my needs this solution worked fine - with the caveat that it's only used in a very narrow context, and as a debug function at that. It's not needed to interoperate except to be able to be pasted into something and viewed. CSV works fine since I already know all of the data going into each cell and none of it will have commas. It can't.
So yeah, if i was doing a more general CSV export I'd definitely take your points. I've typically avoided CSV in favor of formats that allow for robust escaping/data delimiting, but sometimes we're stuck with what we have, rather than what we want =)
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Since I assumed that you got it, my point was intended mostly for the benefit of lurkers who may not have enough experience with CSV data to appreciate its finer points.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting
|
|
|
|
|
codewitch honey crisis wrote: So finally, after coding since 1986, i find a ready, real-world, non-business related programming need for CSV format
Sometimes the simplest solutions are the best.
|
|
|
|
|
103. The cautious conflict the unknown (4)
|
|
|
|
|
|
Ya
|
|
|
|
|
|
Maybe they should have done it based on occupation.
Politicians, Marketing, Sales etc..
A Fine is a Tax for doing something wrong
A Tax is a Fine for doing something good.
|
|
|
|
|
Am I alone in thinking that "BS Study" sounds a tad tautological?
Whenever you find yourself on the side of the majority, it is time to pause and reflect. - Mark Twain
|
|
|
|