Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
The stupid question is the question not asked
 
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 examining the Monastery: (8)
As of 2014-04-19 11:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (480 votes), past polls