Filtering txt files out structs and assign to subfolder

1 visualización (últimos 30 días)
Bas Bloemendaal
Bas Bloemendaal el 24 de Nov. de 2021
Respondida: Shravan Kumar Vankaramoni el 9 de Dic. de 2021
Hi There,
I was trying to filter out the 'CAp_*.txt' files and assign it to the last subfolder, but did not succeed. How can I do this?
Kind Regards,
  1 comentario
Bas Bloemendaal
Bas Bloemendaal el 24 de Nov. de 2021
Found out how to filter on ' CAd':
filtered_struct = directory_text{1,1}(startsWith({directory_text{1,1}.name}, 'CAd'));
However, I cannot assign it to the last subfolder where eacht .txt belongs to.

Iniciar sesión para comentar.

Respuestas (1)

Shravan Kumar Vankaramoni
Shravan Kumar Vankaramoni el 9 de Dic. de 2021
Hi,
You can simply use the below code to filter out the files
files = dir(CAp_*.txt) % This will give all the .txt files starting with CAp_
To copy files to a subfolder, refer the below answer:

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by