Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1435.Advanced search and replace -- How to replace different words conditionally?

User: Dilip -- 2019-02-16          << 1434  1436 >>
Hits: 171
Type: Advanced search and replace   
Search all Advanced search and replace examples
In a line, search for a specific regex with words but do not match words the
dictionary (case insensitive) and tag the numerics alone

&100 cotton in a &99 audi
&77 linen in a &200 benz
&2000 COTTTON in &10 summer

Words in dictionary is in this format (lowercase):
Input Sample:
&100 cotton in a &99 audi
&77 linen in a &200 benz
&2000 COTTON in &10 summer
&2000 Wool in &10 summer
Output Sample:
@100 cotton in a <item>99</item> audi
@77 linen in a <item>200</item> benz
@2000 COTTON in <item>10</item> summer
@2000 Wool in <item>10</item> summer
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Assume dictionary file is d:\test\words.txt
1. ctrl-o open source text file
2. ctrl-h open 'replace' dialog
* set 'search for pattern' to:

* set 'replace with pattern' to:

- click 'advanced' tab:
* set 'run following at the beginning of replace' to:

* set 'run following for each matched unit' to:

3. click 'replace', done.

Note: please use double backslash \\ as folder delimiter such as: d:\\test\\words.txt

Screenshot 1:  Replace_Window

Screenshot 2:  Replace_Advanced_Window

Similar Examples:
How to replace different lines with different rule? (66%)
How to replace text conditionally with custom dictionary? (61%)
How to replace the space with its nearest different words in the same column? (60%)
How to replace the words with its nearest different words in the same column?
How to replace a list of words with one single word? (58%)
How to replace strings in one file with words from another file sequentially? (57%)
How to replace strings with words in a list in sequence or randomly? (57%)
How to replace an random occurrence of an word with an random line? (56%)

Check Demo of Advanced search and replace
conditional  regex  lowercase  condition  different words  diction  dictionary  200  specific  backslash  case delimiter  regex replace  match regex  specific words  double words  different folder  tab delimiter  text to dictionary