file name extraction from load file

14 visualizaciones (últimos 30 días)
Akhtar Rind
Akhtar Rind el 3 de Jul. de 2020
Comentada: Akhtar Rind el 4 de Jul. de 2020
I have load data file to extract data and plots.
A typical file name would be '01_02_20_Cu_1.csv' and I use this as
A1= readcell('01_02_20_Cu_1.csv');
How can I get file name "01_02_20_Cu_1" from load data file as text format?

Respuesta aceptada

Kawin Kumaran
Kawin Kumaran el 3 de Jul. de 2020
fileparts() function can be used to extract file name .
file = '01_02_20_Cu_1.csv';
[~,name,~] = fileparts(file)
The result will be :
name : '01_02_20_Cu_1'
Please refer the following documentation for more information .
  1 comentario
Akhtar Rind
Akhtar Rind el 4 de Jul. de 2020
Fantastic. It worked. Many thanks Kawin.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by