[filename pathname] = uigetfile('*.txt','Please select your name file')%存放name的txt
fid =fopen([pathname filename])
A=fgetl(fid)
fclose(fid)
expression = ','
B=regexp(A,expression,'split')
folder_path=uigetdir('Please select your file folder')%只有400个tif文件在该处
filename_all = dir([folder_path '\*.tif'])
for ii=1:length(B)
oldname=[folder_path '\' filename_all(ii).name]
newname=sprintf(B{ii})
cmd=sprintf('rename %s %s',oldname,newname)
system(cmd)
end
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)