Code covered by the BSD License  

Highlights from
Bulk File Rename

image thumbnail

Bulk File Rename

by

 

GUI Renames multiple files within a folder with same extension

GetFileName(dirname)
function Files = GetFileName(dirname)

% Provide functionality like what command in MATLAB
% $ Created By Konark Kelaiya  (Nov, 2011)


% curdir =uigetdir;
warning off all;
[matrix AllFiles Directories rem] = getextension(dirname);
% AllFiles = struct2cell(dir(dirname));
% 
% AllFiles(:,1:2)=[]; % Remove .. & . directory details
% AllFiles(2:3,:)=[]; % Remove other details of files
% AllFiles(end,:)=[]; % Remove end row
% 
% AllFiles= AllFiles'; % get transpose
% index = cell2mat(AllFiles(1:end,2));
% 
% Directories = AllFiles(index); % store directories
% AllFiles(:,end)=[]; % Remove 2nd Col.
% AllFiles(index)=[]; % Remove directories
% [~, rem] = strtok(AllFiles,'.');
% uniqueext = (strtok(unique(rem,'rows'),'.'))';
% c=cell(1,size(uniqueext,2));
% for i= 1:size(uniqueext,2)
%     c{1,i}={};
% end
% Files= cell2struct(c,uniqueext,2);
% matrix = fieldnames(Files);

for i = 1:size(matrix,1)
 ind = ismember(rem,strcat('.',matrix{i}));
 list =AllFiles(ind);
 Files.(matrix{i}) = list;
end
Files.Directory = Directories;
end

Contact us