Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Find partially matching line in file - print that line to another file

by moklevat (Priest)
on Dec 14, 2007 at 15:05 UTC ( #657047=note: print w/ replies, xml ) Need Help??


in reply to Find partially matching line in file - print that line to another file

It's not entirely clear what output you are expecting from this. I was going to suggest a hash for your filetwo with the numeric portion being the keys and the text portion being the values, but you have duplicate entries for 123456. Are you looking for:

foo bar foobar

Update: Fortunately, others were able to get the gist. Clearly more caffeine is in order. I was wary of running through the entire pattern set of fileone for each line of filetwo without knowing how large your actual files are. Premature optimization...evil...etc.


Comment on Re: Find partially matching line in file - print that line to another file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (20)
As of 2015-07-31 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (278 votes), past polls