FixFileName

버전 1.0.0.0 (1.34 KB) 작성자: Michael Robbins
removes invalid symbols from a filename taking the OS into account, automatically or by specifying a
다운로드 수: 2K
업데이트 날짜: 2005/7/27

라이선스 없음

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

인용 양식

Michael Robbins (2024). FixFileName (https://www.mathworks.com/matlabcentral/fileexchange/8122-fixfilename), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R14SP1
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 String Parsing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0