Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1399.Advanced search and replace -- How to merge lines with identical first row in two files?

User: y8888 -- 2017-08-12          << 1398  1400 >>
Hits: 1370
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How do I merge the first row of the same line? 
Input Sample:
a file: 
111 test1 
2222 test2 
333 abc 
444 ppp 
5555 uuuuu 
 
b file: 
111 uuu 
111 bbb 
111 cc 
2222 aaaaa 
333 ttt
Output Sample:
111 test1;uuu;bbb;cc 
2222 test2;aaaaa 
333 abc;ttt
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Assume your b.txt is in d:\test\ folder 
1. ctrl-o open a.txt 
2. ctrl-h open 'replace' dialgoue 
* set 'replace unit' to 'Line' 
* set 'replace with pattern' to: 
 
* click 'advanced’ tab, set 'run following at the beginning of replace' to: 
 
3. click 'replace', done. 
4. ctrl-s save to file.

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to remove lines from file B.csv with first column come from file A.csv? (62%)
How to remove lines containing specified words in a text file? (58%)
How to merge odd lines from file1 and even lines from file2? (58%)
How to reverse the order of the first column in text file? (58%)
How to parse all the fields in different segment from a text file? (58%)
How to extract lines containg specified words from many files? (57%)
How to copy same lines and combine different lines from 2 files? (57%)
How to batch rename files to the first date found in the files? (57%)

Check Demo of Advanced search and replace
Keywords:
identical  how to merge lines  merge lines  two files  merge line  first row  merg  merge  mer  two  first two words  same words in two files  identical files  merge two lines  merge two txt  folder merge  merge row  row merge