Excel 2003 can't export proper CSV

|

Sounds weird doesn’t it? Excel 2003 is supposed to be able to do everything. And mostly it can. But on the CSV export front it sucks tons more than OpenOffice, which has its own deficiencies.

So here’s the story. In OpenOffice, when exporting data into CSV, you can choose both the field separator (typically comma) and content delimiter (typically double quote). Which is a wise thing, because some other systems that eat CSV as their input can be pretty picky about the input format, and for example, may want the field names to be without quotes, but field content with quotes, or something equally silly. And in OpenOffice it’s fine — you can tweak the export format to your liking and then maybe fix the headers with your editor and you’re done.

Now enter Excel 2003. By default, it dumps data with semicolons without any delimiters, separated by ; (semicolon). When looking for help, here’s what you get:

excel2003_change_csv_delimiter.png

So to change the delimiter, you have to mess with Windows option. Which kinda makes sense in an obscure perverse way. But there’s no way to edit or add content delimiters.

Now I got my stuff done with some searching-replacing in text editor and a 20-second-to-write Perl script that adds and tweaks all the delimiters, but I’m not sure what those people do that are not so much up for scripting.

2 Comments

I just started playing with excel 2007 and now they seem to have removed csv export all together!!

I cant believe it..

I have a very simple tab delimited file that I use as a little database for a web script. During import I told it not to use a content delimiter. I made my changes and exported and suddenly my script chokes on the file. Why? Excel has inserted double quotes on each field it considers text.

BUT THE WHOLE THING IS A TEXT FILE! The most WYSIWYG format there is! I know MS loves making decisions for us, but making unrequested changes to a flat text file is about the biggest no-no there is!

Surely there is some way to turn off this over-engineered ‘intelligence’? But Help is no help. What I’m looking for is a check box that says “Stop trying to be clever and do what I tell you!”

Leave a comment