Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: extract line

by frozenwithjoy (Priest)
on Jul 20, 2013 at 17:15 UTC ( #1045456=note: print w/replies, xml ) Need Help??

in reply to extract line

I made a hash containing all of the part numbers of interest (file 1) then I read through file 2 and printed any lines that have a part number that exists in the hash of part numbers:
#!/usr/bin/env perl use strict; use warnings; my %part_nums = map { $_ => 1 } qw(3478749 3633731); while ( my $line = <DATA> ) { my ($part) = split /:/, $line; print $line if exists $part_nums{$part}; } __DATA__ 3478748:AA:1D:AAA:Descriptions:C:2 3478749:AA:1D:AAA:Descriptions:C:2 3633731:AA:3E:AAA:Descriptions:C:2


3478749:AA:1D:AAA:Descriptions:C:2 3633731:AA:3E:AAA:Descriptions:C:2

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1045456]
[holli]: you should visit the link i posted and answer my question
[stonecolddevin]: good afternoon all
[holli]: if you know what's good for you
[holli]: hahaha
[stonecolddevin]: hey holli, long time no chat
[holli]: g'day sir
[holli]: can you believe they only did nine episodes this season? GoT that is
[holli]: here's the link for you again devin: https://hastebin. com/uhifarelir.rb

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2017-09-26 21:24 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (297 votes). Check out past polls.