Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1060.Advanced search and replace -- How to randomly remove comma delimited sentence fragments?

User: Aaron Allan -- 2013-03-02          << 1059  1061 >>
Hits: 3136
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
This is a variation of 1056.Text sort. I would like to randomly remove comma delimited sentence fragments in two ways: 
 
1. Remove random fragments based on percentage of total fragments. For example, remove 30% of all sentence fragments in text.  
 
2. Remove every nth sentence fragment. For example, remove every 3rd sentence fragment. 
Input Sample:
Input Sample:  
 
Sentence fragment A, fragment B, fragment C, fragment D.  
Sentence fragment E, fragment F, fragment G.  
Sentence fragment H, fragment I, fragment J, fragment K, fragment L.  
etc.
Output Sample:
Output Sample:  
 
1. Sample output (random 30% removed):  
 
  
Sentence fragment A, fragment C, fragment D.  
fragment F, fragment G.  
Sentence fragment H, fragment J, fragment K, 
etc.  
 
 
2. Sample output (Every 3rd fragment removed): 
 
Sentence fragment A, fragment B, fragment D.  
Sentence fragment E, fragment G.  
Sentence fragment H, fragment J, fragment K, 
etc.
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
## Remove 30% of all sentence fragments in each line: 
1. ctrl-o open text file 
2. ctrl-h open replace dialogue 
* set 'replace unit' to 'Chars' 
* set 'replace scope' to 'Line' 
* set 'replace with pattern' to: 
 
* click 'advanced' tab, set 'run following for each matched unit' to: 
 
3. click 'replace', done. 
 
## Remove every 3rd sentence fragment in each line 
1. ctrl-o open text file 
2. ctrl-h open 'replace' dialogue 
* set 'replace unit' to 'Chars' 
* set 'replace scope' to 'Line' 
* set 'unit number filter' to : 
* set 'search for pattern' to: 
 
3. click 'replace', done!

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Screenshot 3:  Replace_Window


Similar Examples:
How to change the order of comma delimited sentence fragments randomly? (74%)
How to extract and remove common lines from multiple files? (54%)
How to random remove x lines from a line range in text file? (53%)
How to remove sentence fragments from File A based on list in File B? (52%)
How to remove duplicate sentences across many articles in different files? (52%)
How to remove some specified characters from multiple filenames? (52%)
How to auto remove/delete consecutive duplicate sentences or phrases in a text file? (51%)
How to randomly replace each word with a list of pre-defined words? (50%)

Check Demo of Advanced search and replace
Keywords:
remove random  delimited  remove comma  3rd  based on  total  sentence  nth  unique  randomly  sort remove comma  tab delimited  replace random every  sort randomly  sort random  random sort  replace comma tab  replace a sentence in all 2