Importing data from *.asc file(s)
Afficher commentaires plus anciens
Hi,
In my day to day work, I log several data using CANalyzer to collect vehicle CAN network data and its a *.asc format. This log file contains all the CAN messages present on the network. But, I'd like to import the whole log file in to Matlab but would like to extract only specific rows. The rows can be identified by specific CAN ID.
For example, if the entire log file has a total of 1000 rows, it could be shared between two CAN IDs as 500 rows with CAN ID '222', and the rest of 500 rows with CAN ID '333'. What I'd like to achieve is, 'To load the entire log file but extract only the rows that contains CAN ID of '222'.
So, could some help me with any script file that would help me to solve this issue please.
Thanks
4 commentaires
Jan
le 17 Avr 2013
Please post example data from the log file. Without knowing the exact format, it is impossible to design a filter for the wanted lines.
NDKA
le 17 Avr 2013
I cannot guess, what the CAN ID is in this text file. Perhaps it is the 2nd number with the integer value, perhaps you mean the last entry "ID = ..." in each line. It is not an efficient idea to let us guess.
Posting the text snippet as text would be much more useful, because we could experiment with the data. Posting the new information inside the original question would be a good method also, because this is the place where reader need the information.
Please explain, if the first 5 lines can be skipped in every case, or how the header can be identified securely.
NDKA
le 17 Avr 2013
Modifié(e) : Walter Roberson
le 17 Avr 2013
Réponse acceptée
Plus de réponses (1)
Mike Scannell
le 14 Fév 2023
1 vote
This is an old question, but still comes up when searching about using Matlab to read CAN .asc files.
Since 2017, the Vehicle Network Toolbox has the function canSignalImport which can read this type of file and provides the ability to import only selected messages.
Catégories
En savoir plus sur Standard File Formats dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
