read 2 bytes out of 4 bytes from a text file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • southbayfae
    New Member
    • Sep 2011
    • 2

    read 2 bytes out of 4 bytes from a text file

    I created a text file contains 4 bytes of data

    AABBCCDD

    I just want to read the first 2 bytes (AABB) to execute it with my program.

    Then I'll need to read the last 2 bytes (CCDD) for another computer routines

    Pls. help
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    You can either read 2 bytes at a time from the file or you can read the entire line and then use the left and right functions to get just the characters you want.

    Comment

    • southbayfae
      New Member
      • Sep 2011
      • 2

      #3
      can someone show me the code to read each line?

      for example:

      I've 2 lines of string in a text file..

      AABBCC
      DDEEFF

      How do I read each line separately?

      I tried to use ReadLine command, but it can only read the first line. Then how do I read the second line at a lter time?

      Pls. help

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        To read the second line, you call ReadLine again.

        Comment

        Working...