User: gxiang -- 2016-06-13 << 1372 1374 >> |
Hits: 3444 |
Type: Text file parser |
Search all Text file parser examples |
Description: |
How to extract lines containg specified words from many files? |
Input Sample: |
file a: aaa bbb ccc zzz Folder f1: file b : i love buffalo aaa the line contain zzz file c: the line contain ccc the line contain aaa again file d: etc. the line contain bbb the line contain none key words |
Output Sample: |
file z: aaa i love buffalo aaa (file b) the line contain aaa again (file c) bbb the line contain bbb (file d) ccc the line contain ccc (file c) zzz the line contain zzz (file b) |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
Assume the working folder is d:\test\ 1. ctrl-o open a.txt 2. ctrl-h open 'replace' dialogue * set 'replace unit' to 'Line' * set 'search for pattern' to: * set 'replace with pattern' to: click 'advanced' tab: * set 'run following for each matched unit' to: 3. click 'replace', done. 4. ctrl-s save to file. |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |