Info

This question is closed. Reopen it to edit or answer.

How to read particular data from text files

1 view (last 30 days)
Mekala balaji
Mekala balaji on 7 Aug 2015
Closed: MATLAB Answer Bot on 20 Aug 2021
I have text file(s). I some how can be able to read them using fid & fopen. After reading, I want to store the data of two types:
  1. When "Additional information" it appears, I want to read the information starting from below this text (Additional information)appears and read up to just above ----- line appears.
  2. When "xy(24 points)" appears, read x, y data below this text (xy(24 points)) appears. I tried using used strtok, but not successes.
Please help me.
1st information I want to store is: # Alarmtype1 heater temp higher, event ID:1040588 # system error:5480 # Alaram, time exceeds
when 5480 appears just store the above line and event ID (1040588). "system error:5480" this is always constant But some time 5480 may appears above in the text file. I only want to consider when it appears after "Additional information" line.
2nd Information I want to store is: data under "xy(24 points)" and that is:
-14 0.28
-13 0.27
-12 0.26
-11 0.25
-10 0.24
-9 0.23
-8 0.23
-7 0.22
-6 0.22
-5 0.22
-4 0.22
-3 0.22
-2 0.22
-1 0.22
0 0.23
1 0.22
2 0.22
3 0.22
4 0.22
5 0.22
6 0.22
7 0.23
8 0.23
9 0.23
10 0.24
11 0.26
12 0.29

Answers (0)

Community Treasure Hunt

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

Start Hunting!