Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1094.Advanced search and replace -- How to replace specific words with its previous words in the same column?

User: shan feng -- 2013-07-03          << 1093  1095 >>
Hits: 3039
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to replace words with its previous words in the same column at one time?
Input Sample:
1 2 3 4 5 6 7  
1 a 2 3 4 5 6 
1 2 3 a 4 5 6 
a 1 2 3 4 5 6 
1 2 3 4 5 6 a
Output Sample:
1 2 3 4 5 6 7 
1 2 2 3 4 5 6 
1 2 3 3 4 5 6 
1 1 2 3 4 5 6 
1 2 3 4 5 6 6
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
First of all, you can transpose the text, such as: 
 
=> 
 
 
1. ctrl-o open text file 
2. ctrl-h open 'replace' dialogue 
* set 'replace with pattern' to: 
 
3. click "replace", done 
 
Secondly, replace every word "a" with previous word in same line: 
 
=> 
 
 
4. ctrl-h open 'replace' dialogue 
* set 'replace unit' to 'word' 
* set 'replace scope' to 'Line' 
* set 'search for pattern' to: 
 
* set 'replace with pattern' to: 
 
5. click 'replace', done. 
 
Lastly, make transpose back, as in step 2,3, and got: 
 
 
Note:  
1. the separator of words must be space in this case, or you should change expressions. 
2. these steps can be saved into one script file(.rst), and can be reused later.

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Window


Similar Examples:
How to replace a words with the previous word in the same column? (89%)
How to replace the words with its nearest different words in the same column?
(76%)
How to replace the space with its nearest different words in the same column? (72%)
How to replace one specified word with a sequence of words from a file? (65%)
How to replace the all word "test" with the first word in same line? (64%)
How to extract lines with specific words in first column? (63%)
How to replace specified word with increasing binary sequence? (63%)
How to replace a list of words with one single word? (55%)

Check Demo of Advanced search and replace
Keywords:
eus  specific words  specific word  transpose  previous  trans  same column  specific  script  scrip  transpose text  replace every 3 word  replace a word one time  replace word one time  change text case  replace with specific  replace unit script  replace same word