I am sure this is covered elsewhere but I have been unable to find it. I am interested in creating a parser that will extract data from a text file and put it into a matrix where it will be viewable in Excel. A sample of my data is below:
Failure Report
Time: 00:12:34
Fault ID: Converter fail
Fault Description: Channel 4 of the converter has failed during tuning
\n
Failure Report
Time: 00:12:37
Fault ID: Comparator 4 Fail
Fault Description: comparator 4 has failed
\n
Failure Report
Time: 00:12:39
Fault ID: Converter fail in practice
Fault Description: Channel 4 of the converter has failed when in mode 5
\n
Failure Report
Time: 00:12:45
Fault ID: Converter 12 Fail
Fault Description: Converter 12 has failed because x = -2 and y = -4
So far I have used an if statement with regexp to find the 'Failure Report' and then go into that message. I can easily extract the time (because it is consistent) with textscan, but I am having problems wrapping my head around how to pull out the Fault ID and the Fault Description because they are irregular in size and type of data in them. Does anyone have a suggestion on how I could go about getting this information in a format like this?
Time________________Fault ID________________Failure Report
00:12:34____________Converter fail__________Channel 4 of the converter has failed during tuning
00:12:37____________Comparator 4 Fail________Comparator 4 has failed
Any help would be greatly appreciated.
~Jenn