Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Extracting Data from .txt file

by 2teez (Priest)
on Apr 25, 2012 at 23:34 UTC ( #967205=note: print w/ replies, xml ) Need Help??


in reply to Extracting Data from .txt file

Like this:

use warnings; use strict; my %hash_val; while (<>) { while (/\b([[:alpha:]]{3}).+?\(.+?(\d+?)\)/gs) { $hash_val{$1} = $2; } } print $_,'=',$hash_val{$_},$/ foreach keys %hash_val;


Comment on Re: Extracting Data from .txt file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2016-02-13 18:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (442 votes), past polls