This app enables you to search for text in *.m files in a folder or folder structure. Then, you may apply replacements to the instances found. Regular expressions may optionally be used in the search text. Currently only *.m files are supported.
This code will modify multiple files within a specified folder structure. Although the app does back up the modified files to your TEMP directory, I STRONGLY RECOMMEND before using this that you also back up your code folder or commit your code to a version controlled repository.
Built by MathWorks Consulting and *requires* you to install GUI Layout Toolbox and Widgets Toolbox. This app is dependent on functionality in those toolboxes.
This app was built by MathWorks Consulting Services. To learn how a MathWorks Consultant can help improve your software development skills, please see:
@Robyn, please update
2020a Warning: JAVACOMPONENT will be removed in a future release. For more information see UI Alternatives for MATLAB Apps on mathworks.com
@Phillip, you could drive this from the command line, yes. You may need to have the app running or add the install folder to your path (MATLAB\Add-Ons\Apps\FindandReplaceinFiles). The code could look like this:
m = csg.app.FindReplaceFiles.Model; %Has various properties you can set, then call methods find() or replace().
m.FindWhat = 'abc';
m.ReplaceWith = 'y';
Is there a way to remotely populate the find and replace fields in this app, like from an external .m file? I'm looking for a way to load a series of find and replace strings from an external list of text strings. Please advise, thanks!
Eddie - sounds like a bug. I've added it to my task list. Thank you for reporting this.
If I double click the search box, the search item will be replaced by a different item in the history list, if I double click again, the search item will go back to the last item. Is this a feature or a bug? (I tried to use the double-click to modify a word in the search term)
Regular expression does not work for 'replace', would love to have that capability esp. used in combination with regexp in find.
This tool fills a gap and works nicely.
However, two details with R2018a
1. "classdef Doer < handle" is depicted with spaces collapsed to one space and without the "<"
2. I would like a checkbox [Monospaced] to improve readability.
Please note this is compatible with R2017a and newer.
Dovud - the source code for this is all included. Just look in the add-on folder after installing this. Or rename the installer to .zip and extract it.
i want to create a dictionary app with matlab and i need the part of code for searching words
can you send me the code, PLEASE
Bugfix for special characters. Switched code font to Monospaced.
Bugfix: corrected the hyperlink location where the original files are backed up