in reply to Re: This has me stumped, pattern matching, 2 files
in thread This has me stumped, pattern matching, 2 files

You're assuming there's exactly one (no more, no less) occurance of Y per line of B.

Asked: "On the 4th, 10th, 17th, 19th and 24th occurance of pattern Y in file B, I should replace pattern Y with pattern Z"

Provided: "On the 4th, 10th, 17th, 19th and 24th line of file B, I should replace the first instance of pattern Y with pattern Z"

  • Comment on Re^2: This has me stumped, pattern matching, 2 files

Replies are listed 'Best First'.
Re^3: This has me stumped, pattern matching, 2 files
by tsk1979 (Scribe) on Nov 21, 2006 at 08:30 UTC
    Yes thats the assumption, and it is true. Per line there will be only one occurance of pattern X in A and pattern Y in B.
      That's "no more". What about "no less"? Will there be an occurance of Y in every line of B?