| User: John -- 2011-03-27 << 750 752 >> |
| Hits: 3559 |
| 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 |