Page 1 of 1
Outputting Tab Delimited File For Excel
Posted: Thu Mar 11, 2004 6:40 pm
by justravis
I have a script outputting a .txt file that seperates fields by \t. When I go to open it in Excel. It says 'SYLK: file format is not valid' The file opend in Notepad, but the words wrap at the wrong places.
Any ideas?
My Excel should open tab delimited text files because it opens 1 I created in Windows Notepad.
Posted: Thu Mar 11, 2004 6:58 pm
by Weirdan
try to separate your lines with this sequence "\r\n"
Posted: Thu Mar 11, 2004 7:03 pm
by justravis
thanx, but it did not make a difference
Re: Outputting Tab Delimited File For Excel
Posted: Thu Mar 11, 2004 9:59 pm
by TheBentinel.com
justravis wrote:'SYLK: file format is not valid'
Microsoft had an article about this, does your file by any chance start with "ID"? Meaning, are the first 2 bytes I and D? If so, you'll get this error when you try to open it.
http://support.microsoft.com/default.as ... -US;323626
The workaround is to change the file contents so that isn't the case. Even changing it to "id" instead of "ID" is enough.
Hope it helps!
WOW!!!!!!!!!!!!!!!!
Posted: Fri Mar 12, 2004 12:16 am
by justravis
I guess i'm lucky you saw that. It solved THAT problem, which is great. NOBODY seemed to have a solution.
Now I go through the text import wizard. Everything looks great there. When I press Finish, I get the error "File not loaded completely." The workbook shows up, but only the first row is imported.
Posted: Fri Mar 12, 2004 5:50 am
by m3mn0n
Never open stuff in Notepad, I recommend using WordPad instead.
It handles the different line breaks properly, where Notepad only likes "\r\n".
Re: WOW!!!!!!!!!!!!!!!!
Posted: Fri Mar 12, 2004 9:42 am
by TheBentinel.com
justravis wrote:only the first row is imported.
Is there anything funky at the end of the row, or the beginning of the next row? something like a binary 0 or something?
If you want to, you can email me the file and I'll see if anything jumps out at me.