Borrar filtros
Borrar filtros

How to extract data from title of multiple folder?

1 visualización (últimos 30 días)
Riyad Khan
Riyad Khan el 19 de Jun. de 2020
Respondida: Nipun Agarwal el 19 de Jun. de 2020
Hi,
I have a folder containing 270 subfolders and I would like to extract the data from the title of each subfolder for further use.
Each folder is similairy titled as so:
P_Tomo_6CMBCM_L_275cluster7_SF_1_XYZ_1448_545_1276_C_1_MD_34_RD_33_S1
I would like to extract the first three numbers following XYZ ( the coordinates) and put them all in a 3x270 array. In this case the coordinates would be:
X = 1448
Y= 545
Z = 1276
Any guidance and help would be appreciated

Respuestas (1)

Nipun Agarwal
Nipun Agarwal el 19 de Jun. de 2020
Hey,
You can follow the following algorithm to solve your problem.
  1. Start with a folder and get list of all subfolders
  2. Find and print names of all subfolders.
You need to use genpath function to list all subfolders.
You can use sprintf to match the file pattern accordingly with your requirements.
For a complete code you can refer this MATLAB answer.

Categorías

Más información sobre Search Path 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