ezeio2:scriptref:csvtogps

Extract a single NMEA lat/long parameter from a CSV formatted string

Description

CSVtoGPS( const data[], item )

Extract single parameter from a CSV formatted string.

Parameters

data CSV formatted string
item Which item to extract. The first item is 1.

Assuming the input data is properly formatted as a CSV string (comma separated), this command finds the item by count and copies the string data into destination, parsing the item as a NMEA GPS lat/long with 6 decimal precision.

ddmm.mmmm, N (North) or S (South) dddmm.mmmm, E (East) or W (West)

Return value

Lat/Long as an integer

Example usage

   new csvdata{} = "$GNGGA,072446.00,3130.5226316,N,12024.0937010,W,4,27,0.5,31.924,M,0.000,M,2.0,*44";
   new lat, lng;
 
   lat = CSVtoGPS( csvdata, 3 ); 
   lng = CSVtoGPS( csvdata, 5 ); 
 
   // lat = 31508710, lng = -120401561
  • ezeio2/scriptref/csvtogps.txt
  • Last modified: 2026-12-01 00:49
  • by andreh