how to extract file name

1 次查看(过去 30 天)
yan abr
yan abr 2017-12-12
评论: yan abr 2017-12-12
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
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 个)

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by