Hi
I have a VB2010 programs that writes a tab delimited text file using
My.Computer.FileSystem.WriteAllText(TheFFn,S,False)
S contains a string of val[tab]val[tab][nl]val[tab]val[tab][nl]
i.e.
A B C
1 2 3
where spaces are tabs
This file is read by Excel later.
In the Excel the formatting is all off. The tabs are basically ignored.
Is there a default encode set someplace? Or what is the default encoding and what does Excel except.
This was done from the production Immediate Window
s = "A,B,C".Replace(",",t) & vbcrlf & "1,2,3".Replace(",",t)
? s
"A B C 1 2 3"
My.Computer.FileSystem.WriteAllText(ztemp & "xx.exl", s, False,System.Text.Encoding.ASCII)
This shows in Excel as
ABC in Cell A1
123 in Cell A2
Tabs ignore and should have been put in different cells.
Does the default encoding change somehow? How can we check?
What is the default encoding if not specified?
What I have tried:
Using different encoding on the WriteAllText. Unicode seems to work but I really need to understand why the default encoding does not work.