User: Aaron -- 2013-07-19 << 1107 1109 >> |
Hits: 5530 |
Type: Text file parser |
Search all Text file parser examples |
Description: |
I would like a script that extracts multiple lines from multiple files based on a keyword or key phrase list. Output files should show lines with keywords in same order as they appear in input file. |
Input Sample: |
Input: file1.txt ......car ......... ....travel.... home... ....... etc. file2.txt ....... ....... home... ....... etc. file3.txt travel... .... travel to Europe... ...... ...... etc. keyword or key phrase file: home car travel to Europe travel etc. |
Output Sample: |
Output files: file1.txt ......car ....travel.... home... etc. file2.txt home... etc. file3.txt travel... travel to Europe... etc. |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
1. Prepare the keywords file as d:\test\keywords.txt 2. ctrl-h open 'replace' dialogue * set 'replace unit' to 'Line' * set 'If=>' to: * click 'advanced' tab, set 'run following at the beginning of replace' to: 3. click 'batch...' button to open "batch runner" window 4. drag multiple text files to 'batch runner' window 5. click 'batch replace', done! Note: please make back up in advance. |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |