Hi I am trying to extract a file name but i don´t want to extract it´s entire name.For example if i have 30 people with 3 different expressions each. I name them as 0101.txt...0103.txt,...,3001.txt...3003.txt. How could i extract only the first 2 digits that represent individual person? Thank you.

 채택된 답변

per isakson
per isakson 2017년 12월 12일
편집: per isakson 2017년 12월 12일

0 개 추천

If I got you question right
cac = { '0101.txt', '0103.txt', '3001.txt', '3003.txt' };
out = regexp( cac, '^\d{2}', 'match' );
out{:}
outputs
ans =
'01'
ans =
'01'
ans =
'30'
ans =
'30'

댓글 수: 1

yan abr
yan abr 2017년 12월 12일
i need to continue with another process on this..but at this stage i got your answer. Thank you very much sir.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

태그

질문:

2017년 12월 12일

댓글:

2017년 12월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by