Replace Pioneer Home
All Examples
Free Download
all
Advanced search and replace
Replace text in multiple files
Regular expression replace
Batch file rename
Batch download
Text file parser
Text file splitter
Html text generator
Search replace binary
Random word generator
Count and statistics
Character encoding
Bin Hex Oct Dec converter
Text generator
Text sort
Text merge
Text data calculation
RSS: Replace Pioneer Examples
49.Advanced search and replace -- Reverse order the 2,3,4,5 words of each line.
User:
sysdemo -- 2007-11-24
<< 48
50 >>
Hits:
3122
Type:
Advanced search and replace
Search all
Advanced search and replace
examples
Description:
Reverse order the 2,3,4,5 words of each line.
Input Sample:
w1 w2 w3 w4 w5 w6 w7 line1
w1 w2 w3 w4 w5 w6 w7 line2
w1 w2 w3 w4 w5 w6 w7 line3
w1 w2 w3 w4 w5 w6 w7 line4
Output Sample:
w1 w5 w4 w3 w2 w6 w7 line1
w1 w5 w4 w3 w2 w6 w7 line2
w1 w5 w4 w3 w2 w6 w7 line3
w1 w5 w4 w3 w2 w6 w7 line4
Answer:
Hint: You need to
Download and install "Replace Pioneer"
on windows platform to finish following steps.
1. ctrl-o open the file
2. ctrl-h open replace dialog:
Settings:
1) Replace unit=line
2) Search for pattern:
.*
3) Replace with pattern:
$match[1,5,4,3,2,6..]
3. Click 'Replace'
Download Script:
scripts/49.rst
Screenshot 1: Replace_Window
Similar Examples:
How to reverse the order of characters in each line of text?
(63%)
How to reverse all the words in each line of a csv file?
(60%)
How to reverse the order of the first column in text file?
(53%)
How to sort the text by the number of specific word in each line?
(52%)
How to split a text file according to first word in each line?
(52%)
How to remove everything after the second specified keywords in each line?
(50%)
How can I reverse the sequence of all words in a text file?
(50%)
How to add a space after the 15 character of each line?
(50%)
Check Demo of
Advanced search and replace
Keywords:
reverse
order
settings
setting
words
each line
word
each
advanced search and replace
replace unit
line order
order line
search words
replace words
words replace
replace 2 words
line of
search line