Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Re: Re: Re: Re: Re: grepping

by dws (Chancellor)
on Mar 26, 2001 at 03:58 UTC ( [id://67087]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Re: Re: grepping
in thread grepping

I agree. You're heading in a direction that relational databases and SQL cover quite well.

If you choose to continue on in Perl, you might get some mileage out of mapping your data rows into hashes.

while ( <DATA2> ) { chomp; my %record; @record{qw(ID COMP TYPE DOC REF)} = split; pushd @data2, \%record; }
will give you an array of (references) to hashes that hold records from your second data file. (You'll need to fill in some code around this, but that should be obvious.) Then, to get an array of IDs you would do something like @ids = map { $_->{'ID'} } @data2; I'll leave the queries as an exercise. You should be able to piece them together based on information given so far in this thread.

Log In?
Username:
Password:

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

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

    No recent polls found