Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

750.Text file splitter -- How to append the second columns of file A and B if first columns are identical?

User: John -- 2011-03-27          << 749  751 >>
Hits: 383
Type: Text file splitter   
Search all Text file splitter examples
Description:
Compare two column in two files. If match, append two files.
Input Sample:
c:\a.txt
column1 column2
================
aaa 123
bbb 123
ccc 123

c:\b.txt
column1 column2
================
aaa 321
bbb 321
ccc 321
Output Sample:
if column1 in both file matches,
append column2 in file a into file b.
c:\b.txt
column1 column2 column3
=======================
aaa 123 321
bbb 123 321
ccc 123 321
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open b.txt
2. ctrl-h open 'replace' dialog
* set 'replace with pattern' to:

* set 'if' to:

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

3. click 'Replace', done!
4. ctrl-s save to b.txt

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to batch append the columns of file A and B if third  columns are identical? (85%)
How to merge the data of second column base on value of first column? (61%)
How to summrize the number of second column grouping by the first column? (56%)
How to find all elements appearing in second column and not appearing in first column?
(56%)
How to merge other columns' data base on the value of the first column? (56%)
How to merge two or more csv files with different columns into one file? (54%)
How to merge two text file base on the value of first column and do sort? (52%)
How to sort file by the number which first appear in each line? (48%)

Check Demo of Text file splitter
Keywords:
identical  transpose  compare  first columns  trans  two files  comp  splitter  text file splitter  how to append  column identical  splitter column  file column splitter  two columns match  file splitter column  column append  append column  splitter replace