Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

751.Advanced search and replace -- How to batch append the columns of file A and B if third columns are identical?

User: John -- 2011-03-27          << 750  752 >>
Hits: 3216
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to batch append the columns of file A and B if third column are identical? 
There are a1...n.txt in folder c:\file1 
There are a1...n.txt in folder c:\file2 
Compare a1..n.txt in both folders, if column3 is matched in both text file,  
append c:\file2\a1.txt into c:\file1\a1.txt 
batch run for each txt in the folder 
Input Sample:
c:\file1\a1.txt 
col1   col2   col3     col4 
--------------------------------- 
1.     ###    bin3      100     
2.     ***    soeng3    200 
3.     &&&    gung1     300 
 
c:\file2\a1.txt 
col1 col2   col3     col4   col5 
--------------------------------------  
1.    ###   bin3     bin     3 
2.    ***   soeng3   soeng   3 
3.    &&&   gung1    gung    1 
 
Output Sample:
c:\output\a1.txt 
col1 col2 col3   col4  col5    col6 
-------------------------------------- 
1.   ###  bin3    100   bin     3  
2.   ***  soeng3  200   soeng   3 
3.   &&&  gung1   300   gung    1    
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. 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: 
 
2. click 'Batch...' button to open 'Batch Runner' window 
* drag files a1...n.txt from foler c:\file1 to 'Batch Runner' window 
* check option of 'Change output folder', and set the following entry to: 
  
3. click 'Batch Replace' button, done.

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to append the second columns of file A and B if first columns are identical? (85%)
How to extract all lines in which first 2 columns are identical? (54%)
How to batch rename files by adding timestamp of current time? (54%)
How to batch rename picture files to the data and time of the pictures? (54%)
How to make math calculation on columns and generate a new column of result? (53%)
How to replace the 4th column if the 5th column is 0? (52%)
How to batch rename html files with specified text from html title tags? (51%)
How to batch rename html files to specified text from html title tags? (51%)

Check Demo of Advanced search and replace
Keywords:
how to batch append the columns of file a and b if third column are identical  identical  compare  third  alt  transpose  trans  folders  toc  comp  batch append text to beginning  batch replace columns in txt file  columns file txt at batch  identical files  batch file output columns to text file  column identical  append columns  batch file output in columns