Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

What is the best way to parse a 488 byte record?

by kfarr (Initiate)
on Jul 24, 2000 at 21:06 UTC ( #24125=perlquestion: print w/replies, xml ) Need Help??

kfarr has asked for the wisdom of the Perl Monks concerning the following question:

I have a very ugly COBOL record descriptor, and need to parse the record into a semicolon delimted format. For this particular record type, the first two bytes comprise the first field, the next four, etc. etc. I suspect an array would make life easy, as I can assemble the final 'product' with a join command. Any ideas?

Originally posted as a Categorized Question.

  • Comment on What is the best way to parse a 488 byte record?

Replies are listed 'Best First'.
Re: What is the best way to parse a 488 byte record?
by fundflow (Chaplain) on Jul 24, 2000 at 21:27 UTC
    It sounds like all you need is this:
    $out=join(";", unpack("A2A4...", $rec));
Re: What is the best way to parse a 488 byte record?
by lhoward (Vicar) on Jul 24, 2000 at 21:10 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://24125]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2021-09-25 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?