Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

170.Advanced search and replace -- How can I reverse the sequence of all words in a text file?

User: editor -- 2008-06-02
Hits: 252
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How can I reverse the sequence of all words in a text file?
Input Sample:
This is a test
Output Sample:
test a is This
Answer:
Hint: You need to Download and install "Replace Pioneer" to finish following steps.
1. ctrl-o open source file.    
2. ctrl-h open 'Replace' dialog,    
in 'Replace' window,     
* fill in 'Search for Pattern':    

* fill in 'Replace with Pattern':

3. click 'Replace', finish.  

Notes: words_r($match,1,-1," "," ") means reverse order of the words from first to last one. Use " " as input delimiter and output delimiter.
Download Script:  scripts/170.rst.zip

Similar Examples:
How to reverse the order of all the lines in a text file? (72%)
Can I count the frequency of each word in a text file? (72%)
How to remove/delete all symbols in a text file? (66%)
How to count and sort the frequency of all words appeared in many text files? (65%)
How to reverse all cases of letters in a text file? (65%)
How to remove/delete all blank lines in a text file? (61%)
How to count how many characters, punctuations in a text file? (59%)
How to remove/delete all English characters in a text file? (59%)

Check Demo of Advanced search and replace