Well House Consultants Ltd.
spacer spacer
Perl Programming - Perl, mod-perl, CGI, etc.
>> Link to main Perl resources
>> Link to forum archive home
>> Link to live forum

Parsing Hex bytes using Perl

Posted by dharshana.ve (dharshana.ve), 25 October 2006
Hi all,

I am a student working on a project using Perl.

My work is...

I have few hex bytes as inputs for my program. Its a series of hex bytes. for eg: 01 0a ab 2a 1c etc...

Here each byte stands for some representation. I also have a data file in which all the representations are stored. For eg:
01 => "abcd"
02 => "ertg"
1c => "srfrf"
etc...

I have to parse the input hex bytes using this data file and the output should show the parsed input series.

The problem i face in linear search id, there are few hex bytes in which the digits are same but the representations are different. For eg: 01 stands for "abcd" and also in some other place it stands for "cdfv" also.

My program follows ASN.1 format. I mean The bytes come in a fashion like TYPE and then LENGTH and then VALUE..

So i have to parse in teh above mentioned manner.

I am unable to come up with an algorithm for the same as i am very new to Perl programming.

Also, the data files are very huge and input also is very huge file in which there are several hex bytes.

So plz can anyone help me in this?



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.
spacer

You can Add a comment or ranking to this page

WELL HOUSE CONSULTANTS LTD • 404, The Spa • Melksham, Wiltshire SN12 6QL • United Kingdom
PHONE: 01144 1225 708225 • FACSIMILE 01144 1225 793803 • EMAIL: info@wellho.net
You are currently on our United States site. Change your country.
Privacy and Copyright StatementTerms and Conditions
Updated Sunday, April 28th 2024 • © Well House Consultants, 2024

This is page http://www.wellho.net/forum/Perl-Programming/Parsing-Hex-bytes-using-Perl.html