Hello! I wanted to ask for some help extracting my positional information. I have two datasets one is positioning and ellipsoidal height in $GPGGA strings and the other is my echosounder data, both of these have time stamps that should match up close enough. What I am currently trying to do (after cleaning and plotting my data)is to link the two together in a master file, but before I can do that I need to extract the latitude and longitude and the ellipsoidal height. I have tried to use textscan but eith no luck. Furthermore, the lines that don't contain the positional info I have to keep blank or as a NaN because otherwise the position would be shiften to a different time which would make it wrong. I hope this makes sense here is an example of my data array. I copied 20 lines as an example. I need to extract each line that starts with $GPGGA and then the value after N and the value after W as well as the value between two M letters. I bolded the data I need to extract. Its all in one line no columns. The lines that start with anything else than $GPGGA I need to keep as a nan. I have tried textscan and multiple other things but can't seem to figure out how to do this step. I think it would have to be something to do with textscan or writing a loop to scan each line I am just unsure where to start with this. I also have another array thats just date and time which corresponds to the position. Thank you for any help I just want to extract each the lat long and ellipsoidal height either in three separate columns or one. Thank you very much for any help or resources shared as well as your time it's very appreciated.