User: tang jin fei -- 2011-08-01 << 829 831 >> |
Hits: 3630 |
Type: Replace text in multiple files |
Search all Replace text in multiple files examples |
Description: |
Hi, I have some files with special format chars in them like a1234, b5678, etc. I have a mapping file like this: a1234 xxxx b5678 yyyy (they are separated by \n) I wish to replace the many a1234s and b5678s with xxxx and yyyy in multiple files. Can anyone please tell me? |
Input Sample: |
file1: ....a1234 file2: ....b5678 mapping file: a1234 xxxx b5678 yyyy |
Output Sample: |
file1: ....xxxx file2: ....yyyy |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
Firstly, you need to convert the mapping file to following format: 1. ctrl-o open mapping file 2. ctrl-h open 'replace' dialog * set 'search for pattern' to: * set 'replace with pattern' to: 3. click 'Replace', done. 4. ctrl-s save to a file like rule.txt Secondly, you can import rule.txt and replace multipe files 5. open "Tools->Batch Runner" menu 6. drag multiple text files to "Batch Runner" window 7. click "Fast Replace" to open "Fast Replace" dialog * click "Import" to import "rule.txt" 8. uncheck "reg exp" option if you only need fixed string replace. 9. click "Start", done. |
Screenshot 1: Replace_Window |
Screenshot 2: Fast_Replace_Window |