how to extract file name
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
yan abr
am 12 Dez. 2017
Kommentiert: yan abr
am 12 Dez. 2017
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.
0 Kommentare
Akzeptierte Antwort
per isakson
am 12 Dez. 2017
Bearbeitet: per isakson
am 12 Dez. 2017
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'
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu File Operations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!