User: lomboz -- 2012-08-04 << 983 985 >> |
Hits: 4937 |
Type: Text file parser |
Search all Text file parser examples |
Description: |
How to extract all lines with specified words? |
Input Sample: |
1.txt <a href="http://xxxx.com">aaaaa</a> <a href="http://yyyy.com">bbbbb</a> <a href="http://cccc.com">ccccc</a> <a href="http://ffff.com">zzzzz</a> 2.txt aaaaa ccccc |
Output Sample: |
<a href="http://xxxx.com">aaaaa</a> <a href="http://cccc.com">ccccc</a> |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
Assume the full path name of 2.txt is d:\test\2.txt 1. ctrl-o open 1.txt 2. ctrl-h open 'replace' dialogue (1) set 'replace unit' to 'Line' (2) set 'replace with pattern' to: (3) uncheck option of "print unmatched unit" (4) set 'if' to: (5) click 'advanced' tab, set 'run following at the beginning of replace' to: 3. click 'replace', done. Note: you need to use real filename to take place of d:\\test\\2.txt in step 2(5), use double backslash(\\) as folder delimiter. |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |