text file data processing
이전 댓글 표시
Dear Experts, It would be great help if somebody can help on this.
I have a text file which I want to read. It has couple of measurements data. In the beginning it starts with texts followed by a data set and then text again and another data set and so on. I want to read each data set and I dont care about the text.The text file looks like:
if true
:MSR 2 # No. of measurement in file
:SYS BDS 0 # Beam Data Scanner System
#
# RFA300 ASCII Measurement Dump ( BDS format )
#
...............
..............
!
#
# X Y Z Dose
#
= -123.9 0.0 32.0 11.8
= -123.6 0.0 32.0 11.9
= -123.2 0.0 32.0 12.1
= -122.7 0.0 32.0 12.2
= -122.2 0.0 32.0 12.5
= -121.7 0.0 32.0 12.6
= -121.4 0.0 32.0 12.6
:EOM # End of Measurement
#
# RFA300 ASCII Measurement Dump ( BDS format )
#
# Measurement number 2
#
%VNR 1.0
!
#
# X Y Z Dose
#
= 132.0 0.0 100.0 8.1
= 131.7 0.0 100.0 8.2
= 131.3 0.0 100.0 8.2
= 130.8 0.0 100.0 8.3
= 130.3 0.0 100.0 8.4
= 129.8 0.0 100.0 8.6
= 129.3 0.0 100.0 8.8
= 129.0 0.0 100.0 8.8
= 128.5 0.0 100.0 8.9
= 128.0 0.0 100.0 9.2
= 127.5 0.0 100.0 9.3
= 127.2 0.0 100.0 9.4
:EOM # End of Measurement
:EOF # End of File
end
From this file I want to read the numerical data under the column header, i.e, X Y Z dose for each measurement. Attached is my text file.
I greatly appreciate any help. Thanks. Rafiq
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!