Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://657047]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-25 20:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found