MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB基础] 如何处理较为复杂的文件格式数据 (https://www.labfans.com/bbs/showthread.php?t=11570)

amadeus 2010-05-20 16:25

如何处理较为复杂的文件格式数据
 
各位前辈,我目前有个较为复杂的数据不知如何处理,请各位帮忙。
文件名称为input.txt
文件内容如下,时间是从50到500:

<data>
<id>788654</id>
<time_>50</time_>
<location_>
<x_>1.00000000e+000</x_>
<y_>3.00000000e+000</y_>
<z_>5.00000000e+000</z_>
<error_>0.00000000e+000</error>
.
.
.
.
.
.
<data>
<id>788654</id>
<time_>500</time_>
<location_>
<x_>14.00000000e+000</x_>
<y_>37.00000000e+000</y_>
<z_>54.00000000e+000</z_>
<error_>0.00000000e+000</error>

我想把它整理成一个txt文件或dat文件,如下
id time x y z
788654 50 1.00000000e+000 3.00000000e+000 5.00000000e+000
.
.
.
.
788654 500 14.00000000e+000 37.00000000e+000 54.00000000e+000

那位前辈有没有好的办法,或例子,谢谢了!!!


所有时间均为北京时间。现在的时间是 05:10

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.