At 02:22 PM 10/25/2006 +0530, Dharshana Eswaran wrote: >The raw files(Given as input) looks like the following: > >0d a1 0b 02 01 02 02 01 0e 30 03 04 01 93 7f 01 00 8b 2a 1c 0d a2 0b 02 01 >03 30 06 02 01 0e 80 01 04 > >The output shud look like the following: > >02 OpCode Tag >01 OpCode Length >26 Foron >0A Reg1 >0B Era1 >0C Act1 >0D De1 >0E Int1 >11 Reg4 >12 Get5 >13 Pro6 >3B Pro7 >3C Uns7 >3D Uns >10 Not8 > >Here The first byte 02 stand for a TYPE >the second byte 01 stands for its LENGTH >the the following bytes after that stands for the possible occurences of the >VALUES.
So ur saying that the data file is essentially a database with variable length fields? Two fixed length fields followed by a variable length field. Like (nn), (nn), (nn nn...). The first step is to just read those in and associate the fields. @bytes = split / /, <DATA>. Then go into a loop to turn that into rows. $type = shift @bytes; $length = shift @bytes; @values = splice @bytes, 0, $length; Then do the translation and output to some file. > >So like this there are many TYPE LENGTH VALUES in the data files... so hex >value in one TLV can have one description and the same hex value in another >can have another description.. Not sure what ur trying to say here. Half ur problem is just defining what the task is. -- REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=-- "...ne cede malis" 00000100 _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs