Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Parse a file and store it in hash of hashes

by rahulruns (Scribe)
on Jan 16, 2017 at 10:13 UTC ( [id://1179653]=note: print w/replies, xml ) Need Help??


in reply to Parse a file and store it in hash of hashes

Few Ideas, you data will look arranged in a better way if you use xml rather than plain file, with that you could parse your xml and store elements of xml as key and value of that element as value for your key. If you want to use only from a plain file you could split on basis of = sign and store them in hash look something like

while my $line (<$fh>){ my ($a, $b) = split (/=/, $line); $hash{$a} = $b ; }
Remember this is not complete code, it is just to give you hint

Replies are listed 'Best First'.
Re^2: Parse a file and store it in hash of hashes
by Sonali (Novice) on Jan 16, 2017 at 10:21 UTC

    No I dont want it in XML format. Thanks for the hint!!

Log In?
Username:
Password:

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

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

    No recent polls found