Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

505.Advanced search and replace -- How to merge 3 text files by getting one line from each file repeatly?

User: editor -- 2010-05-11
Hits: 77
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to merge 3 text files by getting one line from each file repeatly?
I have 3 text files that contain same number of lines, how can I take one line from each file repeatly and generate a new file?
Input Sample:
file1:
a1
a2
a3
...

file2:
b1
b2
b3
...

file3:
c1
c2
c3
...
Output Sample:
merge 3 files together:
a1
b1
c1
a2
b2
c2
a3
b3
c3
...
Answer:
Hint: You need to Download and install "Replace Pioneer" to finish following steps.
1. ctrl-o open file1
2. open menu "File->Load->Column Append file to page
* in setting's dialog, set "word output delimiter" to "other", and fill the entry followed to:

* click "Next" and open the file2
3. repeat step 2 for the file3.
Now the data looks like:

5. ctrl-h open 'Replace' dialog
* in "search for pattern", enter:

* in "replace with pattern", enter:

6. click 'Replace', now all the column "|" will be replaced with new line.

Similar Examples:
How to merge many files into one file, and add filename before each file? (61%)
How to add some text after the 5th line for every file in a directory? (59%)
How to change multiple files, adding filename at the beginning of each file? (57%)
How to sort the text file by the date at the beginning of each line? (56%)
How to sort the lines in a text files by the order of line length? (56%)
How to merge every two lines into one line between (part1) and (partn)?  (55%)
How to merge two files line by line? (55%)
How to rename all files by adding a letter 'x' behind each filename? (55%)

Check Demo of Advanced search and replace