I have a file that looks like xml, but not xml.
I want to read the headers and extract the x and y value. I tried a few ways but not able to do it. Here is the construct
<begin>
<datapt>1<datapt>
<xu>mz<xu>
<xv>152<xv>
<yu>ab<yu>
<yv>100<yv>
<t>1412448635<t>
<end>

댓글 수: 1

I want to extract the all these headers into seperate columns to an excel file using matlab. Any help would be really appreciated

댓글을 달려면 로그인하십시오.

답변 (1개)

Mathieu NOE
Mathieu NOE 2021년 1월 18일

0 개 추천

hello
nothing fancy - but it works !
aa = readlines('data.xml')
for ci = 2:numel(aa)-1
line = char(aa(ci));
ind1 = strfind(line,'>');
ind2 = strfind(line,'<');
data_out{ci-1} = line(ind1(1)+1:ind2(2)-1)
end

카테고리

도움말 센터File Exchange에서 Variables에 대해 자세히 알아보기

제품

질문:

2021년 1월 17일

답변:

2021년 1월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by