1. Assume insert.txt is in the folder of d:\test\ 2. ctrl-o open text file 3. ctrl-h open 'replace' dialogue * set 'replace with pattern' to:

* click 'advanced' tab, set 'run following for each matched unit' to:

4. click 'replace', done!

Note: * you can modify the number "6" in step 3 to control how many lines you want to insert into target file * you can change "$a[$_] $r[$_]" to "$r[$_] $a[$_]" if you want insert text in the start of line.