Home All Groups Group Topic Archive Search About
Author
19 Sep 2006 11:00 PM
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

Author
19 Sep 2006 11:11 PM
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
Author
20 Sep 2006 5:18 PM
Chris Dunaway
Ed wrote:
> 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.
Author
20 Sep 2006 5:25 PM
HKSHK
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