2

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.

Toto
  • 89,455
  • 62
  • 89
  • 125
  • Possible duplicate of [Notepad++ Regex + python script (addition in the replace)](https://stackoverflow.com/questions/35366602/notepad-regex-python-script-addition-in-the-replace) – Toto Mar 03 '19 at 11:02
  • You might want to transform the records into csv and then approach the problem from within a spreadsheet. – Lars Fischer Mar 03 '19 at 15:06
  • Hi my friends , Thank you for your helpful guidance – Banner Designer Mar 03 '19 at 17:41

2 Answers2

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

Julio
  • 5,208
  • 1
  • 13
  • 42
0

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.

Cdub
  • 34
  • 2