Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Parsing a Large file with no reason

by pileofrogs (Priest)
on Jan 28, 2010 at 21:59 UTC ( [id://820259]=note: print w/replies, xml ) Need Help??


in reply to Parsing a Large file with no reason

I don't know if I understand your question, but you could grab the vgname and stick it in a variable like $now_vgname, and do the same with the label and then build your hash when you get the id. EG

... my ($now_vgname,$now_label); while ( <$input_handle> ) { if ( /lsattr -El (\w+)/ ) $now_vgname = $1; next; } if ( /label\s+([\/\w]+)/ ) { $now_label = $1; next; } if ( /lvserial_id\s+([\w\.]+)/ ) { $host_info{VG}->{$now_vgname}->{$1}->{LV} = $now_label next; } }

This code is just to demonstrate the idea, it probably won't work as is.

--Pileofrogs

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-25 02:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found