|
Rob Grainger wrote: gluing an even older Toshiba
satellite to the bottom? sure if you want to spend a few hours in the emergency department with firefighters and nurses falling around laughing at your predicament...
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Well, I guess it's better than cementing your head in a microwave[^] for a YouTube "prank".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I laughed so hard the first time I saw that article. Thanks for reminding me
|
|
|
|
|
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
So long as the microwave is from the 2002 era, everything should be fine.
Outside of a dog, a book is a man's best friend; inside of a dog, it's too dark to read. -- Groucho Marx
|
|
|
|
|
I've been importing from text files, spreadsheets, etc. for over 18 years now. Just when you think you've seen it all a client brings you this:
Each line of a *.csv file starts and ends with double-quotes. Oh yes, we've had handling in place for many years to deal with embedded double-quotes in csv files (generally a sign of formatted numbers)...basically by stripping the formatting between pairs of double-quotes. It's worked great for many years until now...where it unfortunately removed all the commas leaving a big mess...not good! Of course, it's my fault!
It was an easy fix, but I'm still shaking my head over the fact that their programmer who wrote that export told me that he didn't know why it was getting formatted that way, and that it looked fine to him. (due to the fact that the double-quotes didn't show up in Excel...nevermind the fact that column A contained a comma-separated list of the items!)
I must be getting too old to argue, instantly agreed that it was my problem, fixed, tested, signed, sealed and delivered in < 30 minutes. Jpb security I guess!
"Go forth into the source" - Neal Morse
|
|
|
|
|
There is no standard for "CSV" other than the de facto standard of "whatever Excel will open".
Some of the "CSV"s I get have multiple headers and tables.
|
|
|
|
|
There is no standard for "CSV".
Yes, there is: Common Format and MIME Type for CSV Files[^].
(Admittedly, its a bit of a post facto standard)
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
That is not a standard for CSV outside of a very limited domain.
|
|
|
|
|
|
I think that's more of an ISV file, or Idiot Separated Value file.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Brisingr Aerowing wrote: Idiot Separated Value file
But here, we take what we can get, which is why it became my problem...add function isTheWholeFrigginLineDoubleQuoted to set a Boolean PleaseRemoveTheFrigginDoubleQuotesOnlyAtTheBeginningAndEndOfThisLine which when true will perform the needed action. (who says you can't have self-documenting code!)
"Go forth into the source" - Neal Morse
|
|
|
|
|
It's because sadly, it's not the good old days anymore where some things are a given.
Like CSV.
|
|
|
|
|
But hey, at least they can post selfies on Facebook!
Jeremy Falcon
|
|
|
|
|
It sounds like the columns of the rows are being put together in a string variable and the string writing function is wrapping the entire string in double quotes?
|
|
|
|
|
Duncan Edwards Jones wrote: the columns of the rows are being put together in a string variable
That was my guess as well. It could have been easily handled by the other programmer...he knew it was a problem, hence the phone call to me stating that my import isn't working properly with their new file format.
C'mon man, the thing won't even open properly in Excel!
"Go forth into the source" - Neal Morse
|
|
|
|
|
Yeah - I think at this stage I have seen every type of craziness in CSV files - including columns containing the separator in the data with no quotes at all.
|
|
|
|
|
If it won't open in Excel, its because Microsoft didn't plan accordingly.
Isn't that the general thought process? Microsoft should account for everything?
|
|
|
|
|
Oh, it will open in Excel...column A contains comma separated values!
My comment was that it didn't open properly.
"Go forth into the source" - Neal Morse
|
|
|
|
|
|
kmoorevs wrote: (generally a sign of formatted numbers)
Wait, what?
Quoted text is supposed to be string data, particularly when there are commas in it, not a way of saying 'it's a number, Jim, but not as we know it'.
They are really killing that CSV format. I feel your pain.
|
|
|
|
|
Fueled By Caffeine wrote: Quoted text is supposed to be string data
Yes, sorry I misquoted! Yes, what I meant to say was that we apply special treatment to quoted fields/text where a number is expected but never expected each line to be double-quoted.
It basically caused my parsing routine to behave in an unexpected way...not too difficult to fix once you see it coming.
"Go forth into the source" - Neal Morse
|
|
|
|
|
Doesn't that simply import each row as a single field per row? Seems to me your code is working.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
John Simmons / outlaw programmer wrote: Seems to me your code is working.
Getting one field where multiple fields are expected was a problem.
The original logic was just to remove any commas found between double-quotes. Doing this with the single field (of comma delimited values) just pushed everything together and made a mess.
A little added logic to detect if the entire line is wrapped fixed everything. Easy.
The point was that sometimes you just have to take what the client gives you and make it work...that and how lazy (or stupid) the client's dev was for not understanding what the problem was.
"Go forth into the source" - Neal Morse
|
|
|
|
|
So, going through MDN's documented HTTP response status codes I ran into this nugget in the 400's:
418 I'm a teapot
The server refuses the attempt to brew coffee with a teapot.
I can appreciate the sentiment.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|