Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

822.Text file parser -- How to extract all records that contains specified field values?

User: editor -- 2011-07-18          << 821  823 >>
Hits: 2110
Type: Text file parser   
Search all Text file parser examples
Description:
How to extract all records that contains specified field values? 
Given a file will many records, and a name list, how to extract all the records that contain these names?
Input Sample:
Records.txt 
name1 33 F 
name2 25 M 
name3 19 F 
name4 9 M 
... 
 
Namelist: 
name1 
name3
Output Sample:
name1 33 F 
name3 19 F 
...
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open record.txt 
2. ctrl-h open 'replace' dialog 
* set 'replace unit' to 'Line' 
* set 'search for pattern' to nothing 
* set 'replace with pattern' to: 
 
* set 'if' to: 
 
* uncheck 'print unmatched unit' option 
3. click 'replace', done. 
 
Note: you can change the list of 'name1', 'name3' in step2  base on your own need.

Screenshot 1:  Replace_Window


Similar Examples:
How to extract all sentences that contain specified words? (79%)
How to extract all lines that contain specified words or phrases? (77%)
How to extract all lines that contain specific words in a file? (75%)
How to extract all blocks that contain specified strings like "A"? (74%)
How to extract all lines containing words in specified file? (71%)
How to extract sentences that contain specified words from UTF8 file? (69%)
How to extract all sentences that contain special keyword from multiple articles? (69%)
How to extract all lines that contain "abc" from multiple files? (68%)

Check Demo of Text file parser
Keywords:
records  given  give  field  grep  record  contains  names  values  unmatched  extract field  if contains  change file names  replace pattern with nothing  replace file names  file names  how to replace many file name  extract file name