Hi all, I have a text file shown below that is generated every hour and i need to extract the time from the text file and data also. After an hour I need to use another file generated and plot the change in terms of graph

3 vues (au cours des 30 derniers jours)
A sample of text file is shown below, any help is appreciated well in advance

Réponse acceptée

Walter Roberson
Walter Roberson le 20 Nov 2017
fopen() the file. textscan() with a format to read just the entries on the first line, specifying a repeat count of 1 (that count goes after the format specification in the textscan call.) textscan() again, this time with the format to read the data, and giving the HeaderLines, 1 option to skip the text header line that is on the second line of the file. fclose() the file.
  4 commentaires
Walter Roberson
Walter Roberson le 20 Nov 2017
You said you need to read the time. The time is stored on the first line.
Before going a complete solution, it would help to know which columns of the data you want to extract.
Naveen Bandi
Naveen Bandi le 20 Nov 2017
Thank you Walter Roberson for your kind reply.
For reading the data i used fgetl() function. It returns a character array and i choose the subset of array that gives the time and converted that array to time format using the datetime() function. Now for my next steps i want to use drop down box for user input. Based on user input I need to plot particular rows of data from number of similar files(file is same type that is attached). So I would request you to help me with selecting particular rows. Say. Given User selects V01 Nbr:220 and in the second drop box user selects one of Err Name: 20 and in the third dropdown he selects position number as 1: Then I should plot pos1 data versus time from all files time runs from 00:00 to 24:00. There are approximately 25 to 30 files. The file has different Err Name for same V01 Nbr. There are 17 V01 Nbr and for each one there again 17 Err Names and so on.
Please Dont mind to read such a long query
Waiting for your reply,
Thanks and Regards,
Naveen BM

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by