Wednesday, November 29, 2006

Damn Microsoft bug!

Lesson learned:

Do not parse text file that will have "ID" as the first 2 characters in your output. Excel will throw this error if you import the text file containing it...

"SYLK: File format is not valid" error message when you open file

CAUSE

This problem occurs when you open a text file or CSV file and the first two characters of the file are the uppercase letters "I" and "D". For example, the text file may contain the following text:
   ID, STATUS
123, open
456, closed
Note This problem does not occur if the first two letters are lowercase "i" and "d".

WORKAROUND

To open your file in Excel, open the file in a text editor, and then insert an apostrophe at the beginning of the first line of text.