Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1363.Advanced search and replace -- How to replace all lineB to lineA in pattern of lineA-lineB-lineB-...-lineA?

User: Dilip -- 2016-04-21          << 1362  1364 >>
Hits: 1002
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
There is a column in a text file with some wrong entries. Sedan is a correct
entry and SportsCar is also a correct entry but what I want to correct is
this patter

Sedan
SportsCar
Sedan

to
Sedan
Sedan
Sedan


In other words one ore more occurrences of Sedan
followed by any number of
SportsCar
and then followed by one ore more occurrences of Sedan


should all be converted to Sedan
Input Sample:
Sedan
Sedan
SportsCar
SportsCar
Sedan
Sedan
Output Sample:
Sedan
Sedan
Sedan
Sedan
Sedan
Sedan
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open text file.
2. ctrl-h open 'replace' dialogue
* set 'search for pattern' to:

* set 'replace with pattern' to:

3. click 'replace', done.
4. strl-s save to file.

Screenshot 1:  Replace_Window


Similar Examples:
How to replace each line with line have same start word from another file? (51%)
How to replace all duplicate lines with some text? (51%)
How to replace all OLD with NEW only in line 100 to line 300? (51%)
How to replace all accentued letter with the one without accent?
(50%)
How to rename all files by adding a letter 'x' behind each filename? (50%)
How to extract all lines with numbers from many text files? (49%)
How to extract all lines with more than 30 characters from multiple files? (49%)
How to replace all the numbers in a text file to the square value? (49%)

Check Demo of Advanced search and replace
Keywords:
what  ies  correct  convert  conver  any number  port  words  column  colu  what is a search and replace  what is replace  correct match  search by column  words with number  replace number column  more replace  replace any number