Skip line in text file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jimwest1995
    New Member
    • Aug 2007
    • 11

    Skip line in text file

    Hi!

    I have a text file with 60 lines in it and I need to skip to line 51 to begin processing. In VB6 there was .SkipLine but I don't see that function in VB.Net. Any suggestions on how to do this?

    Thanks,
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    You a StreamReader to read the FileStream.
    It has ReadLine()
    Just execute it 51 times or whatever before using the data.

    Comment

    • jimwest1995
      New Member
      • Aug 2007
      • 11

      #3
      Originally posted by Plater
      You a StreamReader to read the FileStream.
      It has ReadLine()
      Just execute it 51 times or whatever before using the data.

      Thank you so much

      So there is nothing like Skipline in VB.NET

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Originally posted by jimwest1995
        Thank you so much

        So there is nothing like Skipline in VB.NET
        Sure there is.

        mystream.Readli ne();

        now the line has been skipped.

        Comment

        • jimwest1995
          New Member
          • Aug 2007
          • 11

          #5
          Originally posted by Plater
          Sure there is.

          mystream.Readli ne();

          now the line has been skipped.

          Oh, what i mean is like skip to line 51 whithout a loop

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            It was probably just a wrapper function anyway.
            You could always write one yourself

            Comment

            • jimwest1995
              New Member
              • Aug 2007
              • 11

              #7
              Originally posted by Plater
              It was probably just a wrapper function anyway.
              You could always write one yourself
              Thank you so much for the help

              Comment

              Working...