http://qs321.pair.com?node_id=657047


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