No BSD License  

Highlights from
FixFileName

Be the first to rate this file! 2 Downloads (last 30 days) File Size: 3.08 KB File ID: #8122
image thumbnail

FixFileName

by Michael Robbins

 

27 Jul 2005 (Updated 27 Jul 2005)

removes invalid symbols from a filename taking the OS into account, automatically or by specifying a

| Watch this File

File Information
Description

FIXFILENAME (oldfilename, sysname, usespaces, eightthree) removes such invalid symbols from a filename taking the OS into account, automatically or by specifying as a parameter
 
  You should update the definitions in the switch statement; I did not
  take much care in researching them.
 
  INPUTS DEFINITION DEFAULT VALUE
    OLDFILENAME input {'adhj?*.8&a','AC li*e.cfg','Lo%g.txt'};
    SYSNAME specified OS automatic
    USESPACES include spaces? 1
    EIGHTTHREE use 8.3 format 0
    EXTENDASCII Use chars 128-255 1
 
  OUTPUTS
    NEWFILENAME
 
  USAGE
   disp('USE DEFAULT');
   disp('fixfilename');
   fixfilename
 
   disp('SPECIFY IN AND OS');
   disp('fixfilename({''adhj?*.8&a'',''AC li*e.cfg'',''Lo%g.txt''},''DOS''))');
   fixfilename({'adhj?*.8&a','AC li*e.cfg','Lo%g.txt'},'DOS')
 
   disp('SPECIFY IN, OS and USESPACES');
   disp('fixfilename({''adhj?*.8&a'',''AC li*e.cfg'',''Lo%g.txt''},''WIN'',1)');
   fixfilename({'adhj?*.8&a','AC li*e.cfg','Lo%g.txt'},'WIN',1)
 
   disp('SPECIFY IN, OS, not USESPACES and EIGHTTHREE');
   disp('fixfilename({''adhj?*.8&a'',''AC li*e.cfg'',''Lo%g.txt''},''WIN'',0,1)');
   fixfilename({'adhj?*.8&a','AC li*e.cfg','Lo%g.txt'},'WIN',0,1)
 
   disp('SPECIFY IN, not USESPACES and EIGHTTHREE WHILE LETTING THE FUNCTION');
   disp('SPECIFY THE os');
   disp('fixfilename({''adhj?*.8&a'',''AC li*e.cfg'',''Lo%g.txt''},[],0,1)');
   fixfilename({'adhj?*.8&a','AC li*e.cfg','Lo%g.txt'},[],0,1)
 
  IT'S NOT FANCY, BUT IT WORKS

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
directories, file name, fileio, filename, files, path, regex, regexp, remove, string, strrep
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.

Contact us