skip to Main Content

Can I do this using notepad++ ?

Bnnr - Details : 
Name : Top90
Size : 468 x 60
file : https://i-d.ir/ad/banners/gif/2014/t/top90-468x60.gif
Telegram : @BannerDesigner
Phone : +989014131211

Bnnr - Details : 
Name : Frootel
Size : 468 x 60
file : https://i-d.ir/ad/banners/gif/2014/f/frootel-468x60.gif
Telegram : @BannerDesigner
Phone : +989014131211

To

12 - Bnnr - Details : 
Name : Top90
Size : 468 x 60
file : https://i-d.ir/ad/banners/gif/2014/t/top90-468x60.gif
Telegram : @BannerDesigner
Phone : +989014131211

13 - Bnnr - Details : 
Name : Frootel
Size : 468 x 60
file : https://i-d.ir/ad/banners/gif/2014/f/frootel-468x60.gif
Telegram : @BannerDesigner
Phone : +989014131211

For example starting point is 12 ,

So i want to add increment counter for each specific phrase.

2

Answers


  1. Look for an existing answer before posting, please.
    Notepad++ incrementally replace

    TL;DR – in notepad++ no, you cannot, but you can in Sublime or TextPad etc.

    Login or Signup to reply.
  2. Yes, this can be done within current funcionality and without requiring extra plugins or tools.

    1. Place at the beginning of the record and press Edit->Column Editor (Alt+C)
    2. Use: “Number to insert”, Initial number => 12, Increase by => 1, Repeat => 7 (7 is because of the number of lines for every record)
    3. You’ll get this result

      12Bnnr - Details : 
      12Name : Top90
      12Size : 468 x 60
      12file : https://i-d.ir/ad/banners/gif/2014/t/top90-468x60.gif
      12Telegram : @BannerDesigner
      12Phone : +989014131211
      12
      13Bnnr - Details : 
      13Name : Frootel
      13Size : 468 x 60
      13file : https://i-d.ir/ad/banners/gif/2014/f/frootel-468x60.gif
      13Telegram : @BannerDesigner
      13Phone : +989014131211
      
    4. Now we will remove the numbers that are not needed. Launch search and replace. Mark the ‘regular expressions’ and Search: ^d++(?!Bnnr - Details), Replace by (nothing). You will get:

      12Bnnr - Details : 
      Name : Top90
      Size : 468 x 60
      file : https://i-d.ir/ad/banners/gif/2014/t/top90-468x60.gif
      Telegram : @BannerDesigner
      Phone : +989014131211
      
      13Bnnr - Details : 
      Name : Frootel
      Size : 468 x 60
      file : https://i-d.ir/ad/banners/gif/2014/f/frootel-468x60.gif
      Telegram : @BannerDesigner
      Phone : +989014131211
      
    5. Now, fix the first line. Search ^(d++)(?=Bnnr - Details), replace by 1 - to get the final result:

      12 - Bnnr - Details : 
      Name : Top90
      Size : 468 x 60
      file : https://i-d.ir/ad/banners/gif/2014/t/top90-468x60.gif
      Telegram : @BannerDesigner
      Phone : +989014131211
      
      13 - Bnnr - Details : 
      Name : Frootel
      Size : 468 x 60
      file : https://i-d.ir/ad/banners/gif/2014/f/frootel-468x60.gif
      Telegram : @BannerDesigner
      Phone : +989014131211
      

    Bear in mind that you can merge steps 4 & 5 within a single click using notepad macros. So you can apply the same thing later more easily. For example:

    Procedure while recording a macro

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search