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
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
Simon Chan
2021년 7월 15일
편집: Simon Chan
2021년 7월 15일
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
Simon Chan
2021년 7월 15일
Modify again to take care of the file name:
for i=1:length(file_list)
data(i)=xml2struct(file_list{i});
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!