|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
text file problemI 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 wrote:
> I have a text file I'm trying to read from with a streamreader. The What do you mean by an "eof" character? What character specifically?> 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 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
2005 too smart for it's own good?
BackgroundWorker thread locking UI Edit a row read file without locking it. Reading text files How to convert an Image file to PDF file convert html string into a html document buttons stopped working Doubling up of data in DataView-bound DataGrid?? Position to a Brazilian software developer ? |
|||||||||||||||||||||||