Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1263.Text generator -- How to get a N*M lines file, given a N-line file and a M-line file?

User: xiaoming -- 2014-11-08          << 1262  1264 >>
Hits: 1461
Type: Text generator   
Search all Text generator examples
Description:
File a contain N lines, file b contain M lines, how generate an N*M lines file, each line is the combination line from each file?
Input Sample:
a.txt
aa
bb
cc

b.txt
1
2
3
...
10

Output Sample:
===============
output 1: c.txt
aa1
aa2
aa3
..
aa10
bb1
bb2
..
bb10
cc1
cc2
..
cc10
===============
output 2: 1.txt, 2.txt, 3.txt
1.txt
aa1
aa2
aa3
..
aa10
2.txt
bb1
bb2
bb3
...
bb10

3.txt
cc1
cc2
cc3
...
cc10
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. put a.txt and b.txt to folder d:\test\
2. open "replace pioneer", ctrl-o open a.txt
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:

* set 'run following for each matched unit' to:

4. click 'replace', file 1.txt, 2.txt, 3.txt will be write to d:\test\ folder
5. ctrl-s save to file c.txt

Note: you should write doube backslash in step 3, like "d:\\test\\b.txt"

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to merge odd lines from file1 and even lines from file2? (60%)
How to split each line of csv file into a single file with specified format? (58%)
How to merge every 3 lines from file A and every 1 line from file B? (58%)
How to save every 8 lines to a new file and skipping 2 lines after? (57%)
How to extract 5 unique lines from a text file with 30 lines? (56%)
How to delete all lines appear in file B from file A? (56%)
How to add line_no before each line of a text file? (55%)
How to join every n lines into 1 line in a text file? (55%)

Check Demo of Text generator
Keywords:
combination  given  give  backslash  slash  write  bina  bin  test  map  split txt replace pioneer  replace pioneer txt split  replace pioneer backslash  write lines  pioneer generator  replace pioneer split  replace pioneer file split  split file replace pioneer