Replace Pioneer Home   All Examples   Free Download

 New request --free

414.Advanced search and replace -- How to merge every two lines into one line between (part1) and (partn)?

User: shuaigemi -- 2010-02-05
Hits: 38
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to merge every two lines into one line between ¡¾part1¡¿and ¡¾partn¡¿ in a text file?
Input Sample:
  .
  .
  .
¡¾part1¡¿

line 1
               (ps:there is a blank line between every two lines)
line 2

line 3

line 4
  .
  .
  .

¡¾part2¡¿(or maybe ¡¾part3¡¿or ¡¾part4¡¿)
  .
  .
  .
Output Sample:
  .
  .
¡¾part1¡¿

line 1    line 2

line 3    line 4
  .
  .
  .

¡¾part2¡¿(or maybe ¡¾part3¡¿or ¡¾part4¡¿)
  .
  .
  .
Answer:
Hint: You need to Download and install "Replace Pioneer" to finish following steps.
1. ctrl-o open source text file
2. ctrl-h open 'replace' dialog:
* in 'search for pattern', fill:

* in 'replace with pattern' fill:

3. click 'Replace', done!
4. ctrl-s save to file.
Download Script:
scripts/414.rst.zip
Check Demo of Advanced search and replace