Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Working with binary data Re:

From: al:bri:xtra at: 27-Sep-2000 13:24

> If I read in a binary file I get this for example: > > variable: #{ > 524946462400000043444441666D742018000000010001005C774C0100000000 > B253000000020000332D0400 > } > > How do I navigate this to get to specific values and extract them and
store them in variables?
> The best I could do is use > data: first variable > > BUT, I would like to be able to extract more than one at a time. >> variable: #{
{ 524946462400000043444441666D742018000000010001005C774C0100000000 { B253000000020000332D0400 { } == #{ 524946462400000043444441666D742018000000010001005C774C0100000000 B253000000020000332D0400 }
>> at variable 2
== #{ 4946462400000043444441666D742018000000010001005C774C0100000000B2 53000000020000332D0400 }
>> first at variable 2
== 73
>> first at variable 3
== 70
>> first at variable 4
== 70
>> first at variable 1
== 82
>> foreach byte variable [print byte]
82 73 70 70 36 0 0 0 67 68 68 65 102 109 116 32 24 0 0 0 1 0 1 0 92 119 76 1 0 0 0 0 178 83 0 0 0 2 0 0 51 45 4 0
>> >> print copy/part at variable 12 5
#{41666D7420} I hope that helps. Andrew Martin ICQ: 26227169 http://members.nbci.com/AndrewMartin/ http://members.xoom.com/AndrewMartin/