Reading ASCII file with header and varying data after certain number of rows
조회 수: 1 (최근 30일)
이전 댓글 표시
I have data file (actually sinex file) containg header information, along with data. The arrange of data is not uniform and after certain number of row, the type of data changes, hereby, I am giving the example.
Header
%=SNX 2.02 TUG 19:312:35135 TUG 18:152:00000 18:182:00000 C 09405 2
*-------------------------------------------------------------------------------
+FILE/REFERENCE
*INFO_TYPE_________ INFO________________________________________________________
DESCRIPTION ITSG-Grace2018_n96_2018-06
SOFTWARE GROOPS
-FILE/REFERENCE
*-------------------------------------------------------------------------------
.
.
.
.
.
.
First data (after 26 lines)
1 CN 2 -- 0 18:167:00000 ---- 2 -4.84169464779211e-04 9.7270e-12
2 CN 2 -- 1 18:167:00000 ---- 2 -4.54239237731450e-10 2.7769e-12
3 SN 2 -- 1 18:167:00000 ---- 2 1.52983517542445e-09 3.0415e-12
4 CN 2 -- 2 18:167:00000 ---- 2 2.43936657466591e-06 3.1010e-12
5 SN 2 -- 2 18:167:00000 ---- 2 -1.40036290147627e-06 3.0824e-12
6 CN 3 -- 0 18:167:00000 ---- 2 9.57223650838727e-07 3.3689e-12
7 CN 3 -- 1 18:167:00000 ---- 2 2.03042471558275e-06 2.4091e-12
8 SN 3 -- 1 18:167:00000 ---- 2 2.48301840776579e-07 2.3248e-12
.
.
.
.
Second Data
1 CN 2 -- 0 18:167:00000 ---- 2 1.93972990977242e+12
2 CN 2 -- 1 18:167:00000 ---- 2 5.66224330188529e+12
3 SN 2 -- 1 18:167:00000 ---- 2 5.25237345945381e+12
4 CN 2 -- 2 18:167:00000 ---- 2 -1.73307223111545e+12
5 SN 2 -- 2 18:167:00000 ---- 2 -2.47741310043326e+12
6 CN 3 -- 0 18:167:00000 ---- 2 6.96651880065224e+12
.
.
.
.
.
.
Third data
1 1 1.15121953185884e+22 1.73756987650400e+21 1.82664373341362e+21
1 4 2.82091597898258e+20 6.06931037084952e+20 -3.07400660603768e+21
1 7 2.21340757149702e+21 1.29058517138195e+21 -1.40888189248258e+21
1 10 -2.51195122034479e+20 -1.87524380123726e+21 1.29288971441302e+21
1 13 -5.72747220888352e+21 -1.68518038400174e+21 -2.56648638333165e+21
1 16 -1.77641267364111e+21 -1.49516972421175e+21 -4.88156149198581e+20
1 19 1.22807465476043e+21 -1.11183731653828e+21 2.67786200389881e+21
1 22 7.89398501965380e+20 -3.69350123138616e+20 2.17375377264516e+20
1 25 1.77090598508143e+21 1.03491787517118e+21 9.97545222832784e+20
1 28 -3.20917334939508e+21 -8.25444495424586e+20 2.46243865543457e+21
1 31 8.10978934743248e+20 1.58991150980513e+21 6.97216232171431e+21
1 34 8.97042334816089e+19 -1.60618421056701e+21 -1.52151216236228e+20
1 37 7.80855689662903e+20 1.31818508545320e+21 -2.58680097565409e+21
1 40 -9.97123589742701e+20 -2.13200206969835e+21 1.10949422285466e+21
.
.
.
.
.
.
All these data are in one file. Can anyone suggest me how to read the data?
댓글 수: 2
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!