Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

535.Regular expression replace -- How to replace the all word "test" with the first word in same line?

User: editor -- 2010-06-14          << 534  536 >>
Hits: 313
Type: Regular expression replace   
Search all Regular expression replace examples
Description:
How to replace the all word "test" with the first word in same line?
Input Sample:
word1 ... test
word2 ...... test ...
word3 ..... test .......
...
Output Sample:
word1 ... word1
word2 ...... word2 ...
word3 ..... word3 .......
...
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source text file
2. ctrl-h open 'replace' window
* set "replace unit" to "line"
* set "Replace with Pattern" entry to:

3. click "Replace", done!

Similar Examples:
How to replace each xxx with the first word in the same line in text file? (68%)
How to replace all the numbers in a text file to the square value? (61%)
How to replace the same words in text files with different strings? (60%)
How to batch rename files with the first word of file contents? (60%)
How to replace the characters in fixed position in each line? (60%)
How to delete all lines whose first word appeared in previous line? (59%)
How to delete the first word in each line in a text file? (59%)
How to split a text file according to first word in each line? (58%)

Check Demo of Regular expression replace
Keywords:
first word  test  same  regular expression  expression  first  rst  regula  regular  word  replace same word  line test  test test test test  first replace line  replace first line  the first line  first line  replace first