i have a strings from a text file:
20130806_083642832,!AIVDM,1,1,,B,13aFeA0P00PEqQNNC4Um7Ow`2@O2,0*5E
20130806_083643032,!AIVDM,2,1,4,B,E>jN6<0W6@1WPab3bPa2@LtP0000:uoH?9Ur,0*50
i need to go through the characters and extract the date at the start then the message that starts after B, (but could also be A,) up until ,0
Any thoughts?
Ok, there are much more elegant ways to solve this, but my following example will give you a feeling on how to manipulate strings in MatLab (Which might be the thing you are having problems with). Here you go:
Output
Just play around with string indexing and with
strcmporstrcmpiand you'll get a feeling and will be able to write much nicer expressions.Now try extracting the date by yourself!
Hope that helps!