Code covered by the BSD License  

Highlights from
Brick Toolbox

image thumbnail
from Brick Toolbox by Thomas Deneux
The Brick Toolbox is a set of utility functions for Matlab.

fn_movefile(pattern,rep)
function fn_movefile(pattern,rep)
% function fn_movefile(pattern,rep)
%---
% rename files in current directory using pattern and rep according to
% regexprep syntax

% Thomas Deneux
% Copyright 2012-2012

d = dir;
for i=3:length(d)
    str1 = d(i).name;
    str2 = regexprep(str1,pattern,rep);
    if ~strcmp(str1,str2)
        disp([str1 ' -> ' str2])
        movefile(str1,str2)
    end
end

Contact us