text file problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ed

    #1

    text file problem

    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

  • Ed

    #2
    Re: text file problem

    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

    Comment

    • Chris Dunaway

      #3
      Re: text file problem

      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.

      Comment

      • HKSHK

        #4
        Re: text file problem

        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

        Comment

        Working...