My copy of Excel 2002 does not allow me to specify column formatting when importing a CSV file, but that turns out to be irrelevant because of how “helpful” Excel insists on being.
New problem! I created a flatfile database in Excel. A typical tuple is made up of seven fields:
name,qty,speaker,zone,amp,keypad,wireless
Since fields “zone” and “amp” are formatted as text when I export it as a CSV file a record should look like:
FAMILY DINING ROOM 101,2,Boston VRi580,“1-1”,“1-1”,Yes,No
but instead becomes:
FAMILY DINING ROOM 101,2,Boston VRi580,1-1,1-1,Yes,No
which could mean “zone” and “amp” have become calculated fields, a feature the CSV format lacks, or should just be treated as text, which is what I want. However, Excel, in its infinite wisdom, interprets them as dates (another feature not found in CSV files) when the file is imported. In fact, in this example 1-1 is read specifically as January 1, 2005, where the current year has been assumed because stupid ol’ me apparently left it off.
I edit the CSV file, thinking I’m forcing those two fields to be treated as straight text because I put them in double quotes, but Excel doesn’t care. No, sirree, that’s still a date. Reformat it as text? Okay, now the date is 38353 since January 1, 2005 is 38353 days after January 1, 1900.
However, if I rename the file from FILENAME.CSV to FILENAME.TXT everything works fine. I don’t even have to add in the quote marks because the wizard UncleBeer mentioned pops up and I can tell Excel what to do. Better yet, I tell it what to do AND IT DOES IT.
How can I force Excel to handle CSV files correctly?