www.pudn.com > LPCToolbox.rar > FIXFILENAME.M
function [sndfile,datfile,ext] = fixfilename(fname) % xxx -> xxx xxx.DAT % xxx. -> xxx.RAW xxx.DAT % xxx.yy -> xxx.yy xxx.DAT % '*' is removed f = deblank(strrep(fname, '*', '')); k = findstr(f, '.'); if isempty(k), sndfile = f; ext = 'raw'; datfile = [f '.dat']; elseif k == length(f), sndfile = [f 'raw']; ext = 'raw'; datfile = [f 'dat']; else sndfile = f; ext = lower(f(k+1:end)); datfile = [f(1:k) 'dat']; end