[New Plugin] MultiReplace
-
I wish you all a Happy New Year.!
The next MultiReplace 2.2.0.9 version will be shipped with Notepad++ 8.6.1 or can be dowloaded here.
Release Notes for 2.2.0.9:
-
“Replace first match only” checkbox: I’ve noticed that this option will be occasionally used, especially when replacing strings with the same find pattern in a list, but with different replace strings. Although achievable by the ‘Use Variables’ option using cond(CNT==1,‘Replace String’).
-
Help Button for 'Use Variables’: A new help button, is now included on the panel.
A big thanks from here to @Coises Coises, the creator of the Columns++ Plugin, providing the template for the HTML help page. -
Enhancement in ‘Use Variables’ with init({}): This feature is closing the gap for self-defined variables. These Variables are integrated into the entire Replace-All process and across all list run replacements.
The init command introduces a way to initialize newly defined variables, ensuring the value is set just once. With this, the newly introduced if-Then feature becomes significantly more useful, especially when combined with other available variables.
1st example:
It is summing digits of Column2 and Column4 and Replaces the 4th found digit in the line:
Find:(\d+)
Replace:init({COL2=0,COL4=0}); cond(LCNT==4, COL2+COL4); if COL==2 then COL2=CAP1 end; if COL==4 then COL4=CAP1 end;
Output:
1,20,text,2,0 -> 1,20,text,2,22.02nd example:
Removes duplicate lines, keeping the first occurrence of each line. Like discussed in this Post.
Find:^(.*)$
Replace:init({MATCH_PREV=1}); cond(MATCH == MATCH_PREV, ''); MATCH_PREV=MATCH;
-
-
A Alan Kilborn referenced this topic on
-
I want to announce the new MultiReplace release 2.3.0.10, bringing new CSV features in Notepad 8.6.3.
Here’s what’s new:
- Sorting Lines in CSV by Columns: Ascend or descend, combining columns in any prioritized order.
- Deleting Multiple Columns: Simultaneously remove various columns, cleaning up any obsolete delimiters.
- Clipboard Column Copying: Instantly copy columns, complete with original delimiters, into the clipboard.
Header Line Sorting Control:
The header line is excluded from sorting by default, as shown in the demo. To alter the number of excluded lines, change
HeaderLines=1
to your desired count in[userdir]\AppData\Roaming\Notepad++\plugins\config\MultiReplace.ini
.Regex Assistance for Numeric Sorting:
To prepare numbers for lexicographical sorting and later remove the added leading zeros, you may use the following regex patterns:
Purpose Find Pattern Replace With Align Numbers with Leading Zeros (Decimal) \b(\d*)\.(\d{2})
set(string.rep("0",9-string.len(string.format("%.2f", CAP1)))..string.format("%.2f", CAP1))
Align Numbers with Leading Zeros (Non-decimal) \b(\d+)
set(string.rep("0",9-string.len(CAP1))..CAP1)
Remove Leading Zeros (Decimal) \b0+(\d*\.\d+)
$1
Remove Leading Zeros (Non-decimal) \b0+(\d*)
$1
Required Settings:
- For “Align Numbers with Leading Zeros” operations:
- Enable ‘Regex’
- Enable ‘Use Variables’
- For “Remove Leading Zeros” operations:
- Enable ‘Regex’
-
These are the latest updates for MultiReplace! Here’s a quick rundown of the recent version releases and their new features and fixes.
MultiReplace 3.0.2.14 (Latest)
Implemented updates:
- Updated the edit field in the list to automatically remove line breaks when pasting, enabling support for complex “Use Variables” statements.
- Added correct escaping of special characters in “Use Variables” when used with regex.
- Optimized nil checks in conditional statement.
- Escaped special characters in languages.ini
MultiReplace 3.0.1.13
Fixed issue where:
- Quotes were removed when pasting.
- Entries were not inserted at the correct position in the list.
- Special characters were removed from CAPs.
MultiReplace 3.0.0.12
- Enhanced Statistics Columns: Added additional columns to display statistics for found and replaced values, providing more detailed insights.
- Improved Sorting Functionality: Enhanced the ability to revert to the original sorting order of the CSV file, even after rows are modified, deleted, or added.
- New Context Menu: Introduced a new context menu for the list, offering a comprehensive overview of all available functions.
- Direct List Editing Features: Users can now perform copy, paste, and edit operations directly within the list.
- Dark Mode Support for Help Page: The help page for the ‘Use Variables’ option now supports Dark Mode.
-
Version 4.0.0.19 has been released and will be included in the next Notepad++ update. Below are the key changes and improvements:
Implemented updates:
- DPI Font Support: Includes automatic DPI scaling for adjusted UI elements. A custom scaling factor ranging from 0.5 to 2.0 can also be set via the
ScaleFactor
variable in fileC:\Users\<Username>\AppData\Roaming\plugins\config\MultiReplace.ini
. - ‘Use Variables’ Feature: Now allows initial setting of variables before processing the complete list by adding a list entry with an empty Find string next to the initial Replace statement.
- Collapsible List Window: The list window can now be expanded or collapsed for better handling and space management.
- Find and Single Replace: Now support selection scope, including rectangular and multi-selection.
- File Handling:
- New ‘Save’ and ‘New File’ buttons for managing list files.
- List files can now be loaded via drag and drop functionality.
- Minor Fixes: Various UI adjustments and bug fixes.
Here’s a visual take on the changes:
Enjoy!
- DPI Font Support: Includes automatic DPI scaling for adjusted UI elements. A custom scaling factor ranging from 0.5 to 2.0 can also be set via the
-
Version 4.1.1.21 has been released and will be included in the next Notepad++ update. Below are the key changes and improvements:
-
Header Column Menu: Right-click on the header to toggle columns like
Find count
,Replace count
,Comments
, andDelete
. -
Comments Column: Add custom comments to entries via the new optional
Comments
column. Existing list files remain fully compatible. -
Column Locking: Lock the width of columns (
Find
,Replace
,Comments
) with a double-click on the header divider. A lock icon shows the status.
- New Variables: Two new variables have been added for “Use Variables” option:
- FNAME: Represents the filename or window title for new, unsaved files.
- FPATH: Represents the full path including the filename, or is empty for new, unsaved files.
- Multilanguage Support: The plugin now supports Danish.
- Configuration Options: Manage settings via the INI file located at
C:\Users\<Username>\AppData\Roaming\Notepad++\plugins\Config\MultiReplace.ini
:- DoubleClickEdits: To disable direct editing on double-click, set
DoubleClickEdits=0
(default: enabled). - Tooltips: To disable tooltips, set
Tooltips=0
(default: enabled). - AlertNotFound: To disable notifications for unsuccessful searches, set
AlertNotFound=0
(default: enabled).
- DoubleClickEdits: To disable direct editing on double-click, set
Here is a visual take on the changes:
-
-
Version 4.3.0.26 has been relased and will be included in the next Notepad++ update. This update is mostly about performance improvements.
Implemented updates:
-
Replace matches: Allows targeted replacements using match indexes like
1
,1,3
or2-5
. -
List Statistics: Displays counts for active, total, current, and selected entries below the list.
(Disabled by default – enable viaListStatistics=1
in the INI file.) -
Use Variables Performance: Significantly faster execution of replacements using the “Use Variables” option.
-
Docs and Language: Minor documentation and wording refinements.
-
-
IMHO the features of this plugin should be implemented directly into N++, maybe adding a further tab page to the current Search and Replace dialog to include the features of this plugin and its future evolution.
-
MultiReplace now also supports Replace in Files. This is another step toward a powerful feature when combined with the list entries. This feature supports all variables used in Use Variables, like
FNAME
andFPATH
, as well as the CSV Scope option, so it is fully integrated.This is a Release Candidate available for testing – if it works for you, feel free to leave a like. If you run into any issues, please report them here.
- Download the ZIP file matching your system.
- Copy its contents into
C:\Program Files\Notepad++\plugins\MultiReplace
. - Done!
Happy replacing!
-
A CTRL-Click on a tab would select it as part of a new scope for multi-documemt replacement.
A new feature very useful when you want to apply search/replace to a list of open documents but not all open documents
-
@Mit-Jean said in [New Plugin] MultiReplace:
A CTRL-Click on a tab would select it
This is not something the MultiReplace plugin has the power to do, as the idea messes with core Notepad++ functionality.
However, nothing is stopping the plugin author from creating some other mechanism within the plugin to do what you want.