File Exchange

image thumbnail

Find and Replace in Files

version 1.1.290 (55.7 KB) by Robyn Jackey
Perform find and replace operations against a folder structure of MATLAB .m files.


Updated 20 Nov 2018

View License

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:

Comments and Ratings (8)

Robyn Jackey

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.

per isakson

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.

Robyn Jackey

Please note this is compatible with R2017a and newer.

Robyn Jackey

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.

Dovud Nadirov

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

MATLAB Release Compatibility
Created with R2018b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: GUI Layout Toolbox, Widgets Toolbox