| User: Nick Makris -- 2009-02-16 << 317 319 >> |
| Hits: 611 |
| Type: Advanced search and replace |
| Search all Advanced search and replace examples |
| Description: |
| I need to replace a constant text, "_TAG_", that appears in a single template file with each occurance of a string value that found in a second file. This second file lists out tall the strings on separate lines. I would like to create a separate output file for each substitution that was made. |
| Input Sample: |
| _TAG_ |
| Output Sample: |
| 1234567 |
| Answer: |
| Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
| Assume template file is d:\mydata\template.txt Second file is strings.txt 1. Import strings.txt into system dictionary 1) ctrl-o open strings.txt 2) ctrl-h open replace dialog * set "replace unit" to "Line" click Advanced page: * set "Run following at the beginning of replace" to: * set "Run following for each matched unit" to: 3) click "Replace", strings.txt will be load into system. 2. Create subsititution files 1) Assume strings.txt has 123 lines, create a new file a.txt with 123 lines, each line is full path name of your template file: 2) Open "Tools->Batch Runner" menu, click "Import List" to import a.txt 3) Change "Set output filename" to output file like: out_###.txt 4) Click "Fast Replace" then click "Add": * enter "Search": * enter "Replace": * click "OK" 5) Click "Start", Done! |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |