Borrar filtros
Borrar filtros

extract name from file name

1 visualización (últimos 30 días)
joo tan
joo tan el 30 de Nov. de 2011
dear all,
i have file which name 200101010000-200101020000.dat..but i need to rename new file using 8 first digit (like 20010101.dat)..how i can extract the name and rename my new file?

Respuesta aceptada

Walter Roberson
Walter Roberson el 30 de Nov. de 2011
curname = '200101010000-200101020000.dat';
newname = curname([1:8 end-3:end]);
movefile(curname, newname);

Más respuestas (0)

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by