Getting parts of strings by index (substring)

Hey all, I’ve been using vvvv for about a day now, and am working on getting data from a GPS unit. My problem is that I need to get substrings from the NMEA strings that come out of the unit (for example, splitting out the degrees and minutes when the device spits out 4717.115 for latitude, which is read as 47 deg, 17.115’).

I suppose the more general question is, is there a way to get substrings from strings?

I started building a substring patch that uses Split, and does some crazy loops…but it seems like that will create a frame delay, which, as I understand, is very undesirable in this enviornment.

Is there any way to do this natively? Or has anyone else written a patch to do it?

Thanks in advance!

-Zach

for this specific number you might use RegExpr to split the first two letters from the rest. anyhow, i bet the format won’t be always the same since the latitude ranges from 0 to 90 in two directions… can you provide more data samples and be more precise what you want to achieve…

look in the patch and watch the regexpr with herr inspektor!

splitstring.v4p (4.5 kB)

Ahh, I didn’t think about using regular expressions.

Actually, in these sentences, they’re always (I believe) the same length. For longitude, it’d DDDMM.MMM, for latitude, it’s DDMM.MMM, where D is degrees and M is minutes. There is an additional field indicating the hemisphere using a single character (E for East, N for North, etc.). I also realized, just before bed last night, that math would work well here too.

Thanks for the help, David!

-Zach

Hey all, I’ve been using vvvv for about a day now, and am working on getting data from a GPS unit. My problem is that I need to get substrings from the NMEA strings that come out of the unit (for example, splitting out the degrees and minutes when the device spits out 4717.115 for latitude, which is read as 47 deg, 17.115’).

I suppose the more general question is, is there a way to get substrings from strings?

I started building a substring patch that uses Split, and does some crazy loops…but it seems like that will create a frame delay, which, as I understand, is very undesirable in this enviornment.

Is there any way to do this natively? Or has anyone else written a patch to do it?

Thanks in advance!

-Zach