I need to insert lines from one file into another file starting at a pattern (pattern_string) using awk. I don't need solutions with sed.
inputfiles: file1.txt and file2.txt
outputfile: mergedfile.txt
Example files:
file1.txt
1
2
pattern_string
7
8
9
file2.txt
3
4
5
6
expected merged file mergedfile.txt
1
2
pattern_string
3
4
5
6
7
8
9