Question read text file

andrews

Well-known member
Joined
Nov 22, 2011
Messages
132
Programming Experience
5-10
Hi,
I want to read a text file with some letters like ? ? ...
I do it with using streamwriter and put it in a string array but those letters are something else.
I think it had to do with the ascii code and others.
How to solve it?
Thanks for any response.
Andrews
 
Hi,

I have no idea what you mean here, (using a StreamWRITER to READ a file???), so you need to be a bit more specific about what you are trying to do, the error that you are getting, and probably post an example of what you are seeing and what you are expecting to see from the reading of this file so that we can help you further.

Cheers,

Ian
 
I see why you could not see the problem.
The forum program had changed my letters.
I am placing now a picture, so you can see the problem.
The first letter is placed in my text file and the other is the result of reading in the string array.
Regards,
problem.jpg
 
Ian,
I found a solution for the chars 1 and 2:
For reading the text file in string array :
Using fs As New FileStream(nm, FileMode.Open)
Using sr As New StreamReader(fs, UTF7)
For writing a text file from a string array:
Using fs As New FileStream(nm, FileMode.Create)
Using sw As New StreamWriter(fs, UTF8)
problem1.jpg
Very strange UTF7 versus UTF8 !

But for char 3 there was no solution
Regards
 
Back
Top