Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1086.Text file parser -- How to keep the key words and delete all the other words?

User: Virginia -- 2013-06-11          << 1085  1087 >>
Hits: 3332
Type: Text file parser   
Search all Text file parser examples
Description:
How to keep the key words and delate all the other words, and seperate these key words with '/'?
Input Sample:
A boy named John. 
John is clever. 
Clever John is a boy.
Output Sample:
boy/John 
John/clever 
clever/John/boy
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
First of all, you must define what is a keyword, prepare a file keywords.txt with format of: 
 
boy 
John 
clever 
... 
steps: 
1. ctrl-o open keywords.txt 
2. ctrl-h open 'replace' dialogue 
* set 'replace unit' to 'Line' 
* set 'replace with pattern' to : 
 
3. click 'replace', all keywords will be imported to system 
 
Then you can extract all keywords from a text file: 
 
4. ctrl-o open text file 
5. ctrl-h open 'replace' dialogue 
* set 'replace unit' to 'Line'(if you want to keep newline) 
* set 'replace with pattern' to: 
 
6. click 'replace', done. 

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Window


Similar Examples:
How to keep all specified words in an article and remove rest words? (59%)
How to replace words in a text file only if they are whole words? (58%)
How to make every word in a text file title case? (55%)
How to replace the same words in text files with different strings? (54%)
How to sort the comma separated words by the length of words? (54%)
How to find from an article all words not appeared in a word list? (51%)
How to delete all columns with more than 8 words in text file? (51%)
How to remove/delete all lines with three symbol '='? (51%)

Check Demo of Text file parser
Keywords:
seperate  newline  keywords  key words  what  grep  keyword  system  key word  define  delate the words  newline delete  delete newline  extract keywords  extract keywords file  keep words  extract keyword  replace newline