magawake has asked for the wisdom of the Perl Monks concerning the following question:
I have a binary file and I would like to get the first,second and third field of the line The first field is with offset zero (ofcourse) which has a size of 2 bytes and its format is binary integer format. The second field is offset 2 and size of 2 bytes with binary integer. The third field has offset of 4 with 2 bytes with binary integer data. I was wondering what is the easiest way to do this? I am getting confused on how to use unpack. also, lets assume one of these fields is ASCII -- Offset 15, size 1 --, how could I see this string? Any thoughts? TIA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unpack offset question
by ikegami (Patriarch) on Mar 28, 2009 at 04:39 UTC | |
by magawake (Novice) on Mar 28, 2009 at 12:09 UTC | |
by ikegami (Patriarch) on Mar 28, 2009 at 18:55 UTC | |
|
Re: unpack offset question
by targetsmart (Curate) on Mar 28, 2009 at 10:07 UTC | |
|
Re: unpack offset question
by magawake (Novice) on Mar 29, 2009 at 16:58 UTC |