User: editor -- 2013-07-09 << 1097 1099 >> |
Hits: 3227 |
Type: Advanced search and replace |
Search all Advanced search and replace examples |
Description: |
How to insert random lines from another file into a target file at random points? |
Input Sample: |
source.txt The man pointed down the street. "Is that your dog?" His friend turned and looked. "I've never seen it before." "Are you sure?" "Yes." insert.txt: LINE1. LINE2. LINE3. |
Output Sample: |
target.txt: The man pointed down the street. LINE2 "Is that your dog?" His friend turned and looked. "I've never seen it before." "Are you sure?" LINE1 "Yes." LINE3 |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
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. |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |