Giter VIP home page Giter VIP logo

Comments (6)

daddel80 avatar daddel80 commented on September 27, 2024 1

I'm planning to enhance the plugin by adding an 'Advanced Replacement' feature with support for counters, positions, line numbers, and dependencies in the next version.

from notepadpp-multireplace.

andry81 avatar andry81 commented on September 27, 2024 1

Thank you, it works!

I have add the list files into mine project https://github.com/andry81/tacklebar

from notepadpp-multireplace.

daddel80 avatar daddel80 commented on September 27, 2024 1

Support of Counter is supported in next v. 2.0.0.7 coming in N++ 8.5.8 with option "Use Variables".

from notepadpp-multireplace.

daddel80 avatar daddel80 commented on September 27, 2024

Directly incrementing numeric values using regex in Notepad++ or MultiReplace isn't feasible. However, in MultiReplace, there's a workaround.You can predefine a list of replacements: start by replacing "button1" with "button2", then "button3" with "button4", and continue this pattern up to the maximum number of elements you anticipate having. Start with the highest numbers in the list to avoid overlap. For buttons without a number, simply replace button= with button1. For ease, you can prepare a CSV list in Excel and load it using the 'Load List' function in MultiReplace. I hope this helps!

Important: Due to an issue found in the Replace function, please download the latest build here , you find it on the right side at the bottom, unzip MultiReplace-Release-x64.zip and copy it into your Notepad++ plugin directory.

from notepadpp-multireplace.

andry81 avatar andry81 commented on September 27, 2024

You can predefine a list of replacements: start by replacing "button1" with "button2", then "button3" with "button4", and continue this pattern up to the maximum number of elements you anticipate having.

This won't work. I need to renumber the keys because of add/move/remove of them.

Enables scripted text replacements through bash script export.

Is there a possibility to run a shell script using some input variables like column number, field value or something like that?

from notepadpp-multireplace.

daddel80 avatar daddel80 commented on September 27, 2024

Alright, I get what you're aiming for. Instead of implementing a direct counter, I gave it a go in MultiReplace with a different approach as an experimental feature, as I find it valuable to test its usefulness.

Here's a step-by-step guide:

  1. Remove Numeric Suffixes:
    Make sure the option Regular Expression is checked.

    Find Replace W C N E R
    (Button|cmd)\d+ $1 X

    This step is to clear all numbers after "Button" and "cmd". This operation should be done without activating the experimental feature.

  2. Prepare Your Replacement List:
    Make sure the option "Match whole word only" is checked.

    Find Replace W C N E R
    Button Button1 X X
    Button Button2 X X
    Button Button3 X X
    cmd cmd1 X X
    cmd cmd2 X X
    cmd cmd3 X X

    ... (continue this pattern up to your expected maximum count)

  3. Activate Experimental Feature:
    Before running the replacement list, activate an experimental feature. When active, each entry in the list will replace only one occurrence in the text, preventing overwriting already assigned numbers.

    • Select any entry in the list
    • Press F11. (works only if an entry is selcted)
      A window will pop up. This feature remains active until you press F11 again or restart N++.
  4. Run Your Replacement List:
    With the experimental feature activated and your replacement list ready, initiate the list. This will sequentially renumber all your "Button" and "cmd" entries.

    For efficient operations, you can activate or deactivate multiple entries in the list by selecting them and pressing 'Space'. Just be cautious about when the experimental feature is activated, as there isn't a visual indication yet.

Download the release containing this feature here.

I hope this helps!

If you encounter any issues, don't hesitate to reach out.

from notepadpp-multireplace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.