Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1373.Text file parser -- How to extract lines containg specified words from many files?

User: gxiang -- 2016-06-13          << 1372  1374 >>
Hits: 3211
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


Similar Examples:
How to extract all lines that contain specific words in a file? (83%)
How to extract random lines containing specified words? (80%)
How to extract sentences that contain specified words from UTF8 file? (80%)
How to extract all lines that contain specified words or phrases? (80%)
How to remove lines containing specified words in a text file? (79%)
How to extract all data followed by specified words from many files? (78%)
How to extract multiple lines in specified order from many text files? (77%)
How to extract all lines containing words in specified file? (75%)

Check Demo of Text file parser
Keywords:
extract lines contain  grep  specified words  extract lines  lines contain  dir  test  content  extract line  ass  extract specified lines  extract lines from files  extract words  txt file parser  match words files  many txt  txt txt test  test txt