samintz
Scott Mintz
- May
- 1,590
- 27
I have a file with contents similar to the following:
I want to read the individual hex bytes in a continuous fashion and ignore the end of line characters and leading whitespace. Is there an easy way to do that?
To be more specific, the data forms records. The first column is 12 bytes. The second is 2, and so on. I want to just read the file in that way - i.e. read 12, read 2, and so on. So using the above as an example, I want to read "8e 00 01 00 00 00 00 00 00 00 00 00" with the 12 byte read and "00 00" on the 2 byte read, and "7f 00" and the next read, etc. That second read spans EOL.
Any easy ideas?
-Scott
Code:
8e 00 01 00 00 00 00 00 00 00 00 00 00
00 7f 00 01 00 69 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 7f 00
51 75 69 63 6b 2d 44 69 72 74 79 20 54 65 73 74 20 66 6f 72 20 4d 6f 74 69
To be more specific, the data forms records. The first column is 12 bytes. The second is 2, and so on. I want to just read the file in that way - i.e. read 12, read 2, and so on. So using the above as an example, I want to read "8e 00 01 00 00 00 00 00 00 00 00 00" with the 12 byte read and "00 00" on the 2 byte read, and "7f 00" and the next read, etc. That second read spans EOL.
Any easy ideas?
-Scott