in reply to How to skip first n character from data and read every m character..

I'll elaborate a bit more on the previous answers.

Take a look at the documentation (using perldoc -f) for the read and seek functions, and for the substr function.

You can use seek to "skip" past parts of a file (let's say 9 bytes), and "read" to read x bytes from your current position in a file.

You could just read the first 9 bytes and throw them away, but seek is better in the general case, so it's not a bad idea to learn about it now.

If your data is in memory, "substr" will let you access any part of it you want, for example the 100 bytes starting at byte 9.


Mike
  • Comment on Re: How to skip first n character from data and read every m character..