Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Parsing a Tagged File Format

by hossman (Prior)
on May 01, 2003 at 01:00 UTC ( [id://254545]=note: print w/replies, xml ) Need Help??


in reply to Parsing a Tagged File Format

If you want a compact (and illegible) solution...
#!/usr/local/bin/perl -w use strict; use Data::Dumper; undef $/; my %t = <DATA> =~ /(\w{2})\s+((?:.+\n)(?:\s{2}.+\n)*)/g; grep { $t{$_} = [split /\n\s*/, $t{$_}]; } keys %t; print Dumper(\%t); __DATA__ T1 Line1 T2 Line2 Line3 Line4 T3 Line5 Line6 ER

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-19 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found