Rename 10000 Text files

조회 수: 1 (최근 30일)
Sumit Saha
Sumit Saha 2021년 1월 1일
편집: Image Analyst 2021년 1월 1일
I've 10000 text file but want to change the name. How can i rename these files ?
example- IND.X0kY0k.HXX.txt to 1.txt like wise for every files

답변 (1개)

Ive J
Ive J 2021년 1월 1일
files = {'tab1.txt', 'tab2.txt'};
target = replace(files, 'tab', '');
cellfun(@(x, y)movefile(x, y), files, target)
  댓글 수: 1
Image Analyst
Image Analyst 2021년 1월 1일
편집: Image Analyst 2021년 1월 1일
Did you try
files = {'example- IND.X0kY0k.HXX.txt', 'example- IND.X0kY0k.HXY.txt'};
target = replace(files, '.HXX.txt', '.txt');
% Be careful with others because they'd overwrite the .HXX one.
%target = replace(files, '.HXY.txt', '.txt');
%target = replace(files, '.HXZ.txt', '.txt');
cellfun(@(x, y)movefile(x, y), files, target)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by