Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

989.Text merge -- After each line, how to insert 1-10 random lines from other files?

User: Aaron -- 2012-08-12          << 988  990 >>
Hits: 4214
Type: Text merge   
Search all Text merge examples
Description:
After every line in source file insert 1-10 random lines from single or multiple texts. In batch mode only one line from each text is inserted then second line from another text etc. before repeating cycle. Range of random lines can be changed to suit requirements.
Input Sample:
The quick brown fox jumped over the bush. 
The lazy dog fell asleep. 
The little boy ran away. 
etc.
Output Sample:
The quick brown fox jumped over the bush.  
dfadf adf klkl' dfadkl k;lk. (eg. from file 5) 
789879879 78979007 78987989. (eg. from file 2)   
uioui io[o[i oip ipoi [oiip. (eg. from file 4) 
21312356 6565436 34656 4332. (eg. from file 1) 
The lazy dog fell asleep. 
nm,nyo pypypn nhjkl hjlkj.   (eg. from file 3) 
qerqeqe 890809808 jkjlk.     (eg. from file 1) 
The little boy ran away. 
qweqwe 8908089 jkljkljl.     (eg. from file 4) 
etc. 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. first of all, merge multiple text files into a single file, such as d:\test\single.txt 
2. ctrl-o open source text file 
3. ctrl-h open 'replace' dialogue 
* set 'replace unit' to 'Line' 
* set 'replace with pattern' to: 
 
* click 'advanced' tab 
set 'run following at the beginning of replace' to: 
 
4. click 'replace', done!

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to join every sequential line with a random line in a text file? (61%)
How to extract last 100 lines from multiple files? (57%)
How to replace each xxx with the first word in the same line in text file? (57%)
How to duplicate each line 5 times in a text file? (57%)
How to insert random lines from one file into another file at random points?
(56%)
How to delete the first 1-10 lines in many files?  (56%)
How to replace some text with a random line from another file? (55%)
How to batch rename text files with random line from file contents? (54%)

Check Demo of Text merge
Keywords:
cycle  110  repeating  101  tabs  requirement  asp  abs  merge multiple  mode  batch mode random  merge every other line  insert random lines in text files  cycle replace  insert random lines from multiple files  insert only first line in text file  insert random line from file  insert random lines from each file