| User: editor -- 2013-03-25 << 1066 1068 >> |
| Hits: 5188 |
| Type: Text file parser |
| Search all Text file parser examples |
| Description: |
| How to search specific strings and save each instance into a text file? For example, search everything between <b> and </b>, and save to 1.txt, 2.txt, 3.txt, etc. |
| Input Sample: |
| <html> <b>text1</b> ... <b>text2</b> ... <b>text3</b> ... <b>text4</b> ... </html> |
| Output Sample: |
| 1.txt: text1 2.txt: text2 3.txt: text3 4.txt: text4 |
| Answer: |
| Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
| 1. ctrl-o open 'text' file 2. ctrl-h open 'replace' dialogue * set 'search for pattern' to: * set 'replace with pattern' to: * click 'advanced' tab, set 'run following for each matched unit' to: 3. click 'Replace', all file 1.txt, 2.txt ... will be saved in d:\test\ folder. Note: folder delimiter should be double backslash, such as: d:\\test\\$word_no.txt |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |