onedizzydevil
Programmer
First, let me state this sounds like a pretty remedial question but I have been stumped off and on for last two months and now it is time to ask.
I am dealing with text files the way that I am currently doing it is like this.
[tt]Dim strBody As New StringBuilder
strBody.Append("Thank you for your order.")
strBody.Append(vbCrLf, 1)
strBody.Append("The details of your order follow.")
strBody.Append(vbCrLf, 2)
strBody.Append("Bill To")
strBody.Append(vbCrLf, 1)
strBody.Append("-----------------------------")
strBody.Append(vbCrLf, 1)
If Not File.Exists(FilePath & FileName) Then
FileWriter = File.AppendText(FilePath & FileName)
FileWriter.Write(strBody.ToString)
FileWriter.Close()
Else
'...
End If
[/tt]
The problem is this. If I open the file in Notepad the vbCrLf cause a block character to show up. And this seems to work fine when sending an email. However, ASCII text file readers will not read the files the get stuck on the vbCrLf character.
Now when I looked at the file in HEX code the vbCrLf generates an 0D 0A which is mean Chr(13) & Chr(10).
Now if I make a text file in Notepad and I press Enter to get a new line I do not get a block character but a new line. Soooo.. I save this file and look at in HEX and the character that generates the new line are 0D 0A as well.
And the ASCII text file readers will read that file just fine. What the heck it going on????
HELLLLLLLLLLLLP! ME!
Thanks
-Wayne
Wayne Sellars
"Programming, today is a race between software developers, striving to build bigger and better idiot-proof programs, and the Universe, trying to produce bigger and better idiots. So far, Universe 1 - Programmers 0."
I am dealing with text files the way that I am currently doing it is like this.
[tt]Dim strBody As New StringBuilder
strBody.Append("Thank you for your order.")
strBody.Append(vbCrLf, 1)
strBody.Append("The details of your order follow.")
strBody.Append(vbCrLf, 2)
strBody.Append("Bill To")
strBody.Append(vbCrLf, 1)
strBody.Append("-----------------------------")
strBody.Append(vbCrLf, 1)
If Not File.Exists(FilePath & FileName) Then
FileWriter = File.AppendText(FilePath & FileName)
FileWriter.Write(strBody.ToString)
FileWriter.Close()
Else
'...
End If
[/tt]
The problem is this. If I open the file in Notepad the vbCrLf cause a block character to show up. And this seems to work fine when sending an email. However, ASCII text file readers will not read the files the get stuck on the vbCrLf character.
Now when I looked at the file in HEX code the vbCrLf generates an 0D 0A which is mean Chr(13) & Chr(10).
Now if I make a text file in Notepad and I press Enter to get a new line I do not get a block character but a new line. Soooo.. I save this file and look at in HEX and the character that generates the new line are 0D 0A as well.
And the ASCII text file readers will read that file just fine. What the heck it going on????
HELLLLLLLLLLLLP! ME!
Thanks
-Wayne
Wayne Sellars
"Programming, today is a race between software developers, striving to build bigger and better idiot-proof programs, and the Universe, trying to produce bigger and better idiots. So far, Universe 1 - Programmers 0."