extracting specific values between two characters within text file
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
sermet
el 10 de Mzo. de 2017
Comentada: Guillaume
el 10 de Mzo. de 2017
I have a data text file. One parts of this file looks like;
<Almanacs>
<svAlmanac>
<SVID>01</SVID>
<almanac>
<aSqRoot>0.0253906</aSqRoot>
<ecc>7.62939e-05</ecc>
<deltai>0.00683594</deltai>
<omega0>0.882233</omega0>
<omegaDot>-1.86265e-09</omegaDot>
<w>0.155792</w>
<m0>0.036377</m0>
<af0>-7.62939e-06</af0>
<af1>-1.09139e-11</af1>
<iod>1</iod>
<t0a>461400</t0a>
<wna>2</wna>
I need to extract each numeric values between > and < orderly. These numeric values' fractional parts are not constant within the data file.
0 comentarios
Respuesta aceptada
Image Analyst
el 10 de Mzo. de 2017
See the help on "Importing XML Documents". You can probably use xmlread().
1 comentario
Guillaume
el 10 de Mzo. de 2017
Yes, the file looks like xml, which shouldn't be parsed as if it was a text file without a great deal of care.
In particular, the order in which the tags appear is not guaranteed at all with xml, so just reading the numerical values without checking which tag they belong to would be extremely foolish.
Más respuestas (0)
Ver también
Categorías
Más información sobre Text Files 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!