MATLAB Answers

Trying to extract data from an assigned header

12 views (last 30 days)
Venkatakrishnan Rengarajan
Answered: Mathieu NOE on 18 Jan 2021
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

  1 Comment

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

Sign in to comment.

Answers (1)

Mathieu NOE
Mathieu NOE on 18 Jan 2021
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)


Sign in to comment.


Community Treasure Hunt

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

Start Hunting!

Translated by