Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1354.Text merge -- How to copy same lines and combine different lines from 2 files?

User: user -- 2016-03-19          << 1353  1355 >>
Hits: 881
Type: Text merge   
Search all Text merge examples
Description:
How to combine 2 files into one file, in which all paragraph can be combined if
one line of paragraph is same in two files.
Every file has the same structure, in which every paragraph is delimited by blank
lines. Each paragraph has three lines, the first and second lines are same in two
files, and the third line is different.
Input Sample:
File 1:

1
1.1
What's going on?

2
2.1
What do you mean?


File 2:

1
1.1
怎么了?

2
2.1
什么怎么了?
Output Sample:
1
1.1
What's going on?
怎么了?

2
2.1
What do you mean?
什么怎么了?
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
0. put file 2.txt in d:\test\ folder
1. ctrl-o open text file
2. ctrl-h open 'replace' dialogue
* set 'replace unit' to 'Line'
* set 'replace with pattern' to:

* set 'if =>' to:

* click 'advanced' tab, set 'run following at the beginning of replace' to:

3. click 'replace', done.

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to merge odd lines from file1 and even lines from file2? (65%)
How to extract specified lines in different section of text file? (63%)
How to join hundreds of columns in different files into one csv file? (63%)
How to match same lines between 2 files and combine the line followed? (61%)
How to pick up paired lines with specified rules in a text files? (61%)
How to join same language lines into 1 line in a text file? (60%)
How to save specified lines of text file into different files? (60%)
How to parse all the fields in different segment from a text file? (60%)

Check Demo of Text merge
Keywords:
delimited  third  combine  two files  text merge  merg  merge  mer  two  second line  combined paragraph pattern  split every second line  copy merge files  merge every two lines  first three  merge two lines of text  merge every two lines into one  second third paragraph