Hi everyone! Please I need some help with batch importing a bunch of xml file files I have in a folder into my workspace. I tried to use xml2struct but it only gets one
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Daniel Abraham
le 15 Juil 2021
Commenté : Simon Chan
le 15 Juil 2021
clear all
clc
[file_list,path_name]=uigetfile('.xml', 'Grab the files you want to process', 'Multiselect', 'on' );
%%
for i=1:length(file_list)
filename=file_list(i);
data=xml2struct('filename')
end
% Using the xml2struct with a path to each xml file works but my problem is
% how to loop through each file in the folder
0 commentaires
Réponse acceptée
Simon Chan
le 15 Juil 2021
Modifié(e) : Simon Chan
le 15 Juil 2021
Try to add the indexing for variable 'data' and each file name
for i=1:length(file_list)
data(i)=xml2struct(file_list{i})
end
2 commentaires
Simon Chan
le 15 Juil 2021
Modify again to take care of the file name:
for i=1:length(file_list)
data(i)=xml2struct(file_list{i});
end
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Import and Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!