text file problem

  • Thread starter Thread starter Ed
  • Start date Start date
E

Ed

I have a text file I'm trying to read from with a streamreader. The
problem is that the first character is an eof character and is fooling
the streamreader into thinking there is no more data to read. How can
I programatically delete this first character out of the text file if I
can't even read past it? Or how can I read the text file even with this
character in the file?
Thanks
Ed
 
P.S. I just used VBA to open the file and read in the character that's
giving VB.NET a fit and it has an ASCII code of "1" if that's any help.
Ed
 
Ed said:
I have a text file I'm trying to read from with a streamreader. The
problem is that the first character is an eof character and is fooling
the streamreader into thinking there is no more data to read. How can
I programatically delete this first character out of the text file if I
can't even read past it? Or how can I read the text file even with this
character in the file?
Thanks
Ed

What do you mean by an "eof" character? What character specifically?
What encoding are you using?

I didn't think text files in the Windows world even used EOF characters
anymore.
 
Dear Ed,

if a file contains the EOF character (ASCII value 26) at any position
then you should treat it as a binary file. Since stream reader does not
care about any value in a binary file, you can continue reading to the
end of the file.

Best Regards,

HKSHK
 
Back
Top