Related to this question, I have this data sample saved in a .txt file:
'1458937887.70818 $GPGGA,200228.90,3555.3269,N,15552.9641,A*25'
'1458937887.709668 $GPVTG,56.740,T,56.740,M,
0.069,N,0.127,K,D*2D'
'1458937887.712022 $GPGGA,200229.00,3555.3269,N,
15552.9641,C*2B'
'1458937887.714071 $GPVTG,286.847,T,286.847,M,0.028,N,0.051,K,D*28'
I use the following to read the data:
textscan(fileID,'%s','Delimiter','\n')
However, the \n
is not what I want. I want to define another delimiter to be a letter (alphanumeric), followed by *
, followed by two letters (alphanumeric), then a \n
.
Edit: The main problem is that some data are saved into two lines. For example, line 2 and 3 above belongs to the same data packet.