Hi,
I have two set of files. I need to match a pattern from one file and insert the matched pattern into the second file at the same line where I found the pattern in the first file.
The pattern to be matched can be a user input.
Any help would be greatly appreciated.
Thanks in advance.
eg:
File 1
======
This is a great forum and I like it very much.
My name is skuthe and I am not an awk programmer dude.
I hope to get answers quickly.
Everybody is a good programmer here.
File 2
======
Jack
Henry
James
Tom
Rick
...
..
I need to search the work "programmer" in file 1. The word in the file 1 is found on line 2 and 4, Therefore I need to insert the whole thing on line no. 2 after the word programmer at line # 2 in file2 and line 4 at the line # 4 in file2.
After the said program execution the file2 should look as follows..
File 2
======
Jack
programmer dude
Henry
programmer here
James
Tom
Rick
...
..
I have two set of files. I need to match a pattern from one file and insert the matched pattern into the second file at the same line where I found the pattern in the first file.
The pattern to be matched can be a user input.
Any help would be greatly appreciated.
Thanks in advance.
eg:
File 1
======
This is a great forum and I like it very much.
My name is skuthe and I am not an awk programmer dude.
I hope to get answers quickly.
Everybody is a good programmer here.
File 2
======
Jack
Henry
James
Tom
Rick
...
..
I need to search the work "programmer" in file 1. The word in the file 1 is found on line 2 and 4, Therefore I need to insert the whole thing on line no. 2 after the word programmer at line # 2 in file2 and line 4 at the line # 4 in file2.
After the said program execution the file2 should look as follows..
File 2
======
Jack
programmer dude
Henry
programmer here
James
Tom
Rick
...
..