Parse-O-Matic
Home Sitemap
 

About the PSKB / Terms of Use


Installing and running a script


;=============================================================================== ; ; Convert GPS data (NMEA 0183 RMC Format) to CSV (Comma Separated Value) ; format. You can import the export file into a spreadsheet, a database, ; or a mapping program that wasn't specifically designed for GPS logs ; but can read CSV files. ; ;------------------------------------------------------------------------------- ; ; This is merely a sample demo script. Obviously you could modify it to ; filter and analyze the information that interests you, change the way ; the data is shown, perform calculations, and so on. ; ; The basic rationale used in this script can also be applied to more ; complex sentence formats such as GGA, GLL, GSA, GSV, VTG -- all you ; will be doing is extracting different fields. ; ; May your ordnance survey maps always fold neatly! ; ;------------------------------------------------------------------------------- ; ; This script is designed for use with the Parse-O-Matic Power Tool. ; You can download an evaluation copy from www.parse-o-matic. ; ;=============================================================================== ; Config Section ;=============================================================================== Config $CfgEnableOptionX = 'N' $CfgEnableOptionY = 'N' $CfgEnableOptionZ = 'N' $CfgVersion = '1.00.00' $CfgProgrammer = 'Timothy Campbell' AtSym = $40 ; Anti-spam gimmick $CfgEmail = 'info' AtSym 'parse-o-matic.com' End ;=============================================================================== ; TaskInit Step ;=============================================================================== TaskInit NumRecsOut = 0 ;----------------------------------------------------------------------------- ; You can comment and uncomment the symbols you want use for the degrees ; and minutes symbols in the output. In the original version of this file ; we used the actual degree║ and minutes' symbols, but this might not be ; appropriate for your requirement. ;----------------------------------------------------------------------------- ; DegreeSymbol = ' deg ' DegreeSymbol = '║ ' ; MinuteSymbol = ' min ' MinuteSymbol = ''' ' ; Doubling of the quotes here means a single quote End ;=============================================================================== ; TaskDone Step ;=============================================================================== TaskDone LogMsgLF If NumRecsOut = 0 LogMsg 'Records sent to output: None' Otherwise LogMsg 'Records sent to output: ' NumRecsOut End ;=============================================================================== ; Main Step ;=============================================================================== ; Ignore lines containing data we cannot use ;------------------------------------------------------------------------------- If $Data[1 7] <> '$GPRMC,' Done ;------------------------------------------------------------------------------- ; Parse out the fields. These follow the format: ; $GPRMC,hhmmss.sss,w,ddmm.mmmm,c,dddmm.mmmm,c,xxx.x,xxx.x,ddmmyy,,*CS ;------------------------------------------------------------------------------- $Ignore = Parse $Data '' ',' 'Cut' UTCTimeOfFix = Parse $Data '' ',' 'Cut' Status = Parse $Data '' ',' 'Cut' NLatitude = Parse $Data '' ',' 'Cut' LatHemisphere = Parse $Data '' ',' 'Cut' ELongitude = Parse $Data '' ',' 'Cut' LngHemisphere = Parse $Data '' ',' 'Cut' SpeedOverGround = Parse $Data '' ',' 'Cut' CourseOverGround = Parse $Data '' ',' 'Cut' DayMonthYear = Parse $Data '' ',' 'Cut' ;------------------------------------------------------------------------------- ; Tidy up the fields ;------------------------------------------------------------------------------- Insert UTCTimeOfFix 5 ':' Insert UTCTimeOfFix 3 ':' If Status = 'A' Status = 'Okay' If Status = 'V' Status = 'Warn' Insert NLatitude 3 DegreeSymbol NLatitude = NLatitude MinuteSymbol LatHemisphere Insert ELongitude 3 DegreeSymbol ELongitude = ELongitude MinuteSymbol LngHemisphere Insert DayMonthYear 5 '/' Insert DayMonthYear 3 '/' ;------------------------------------------------------------------------------- ; Any filtering and analysis you want to do would typically go here. ;------------------------------------------------------------------------------- ; Nil ;------------------------------------------------------------------------------- ; Output ;------------------------------------------------------------------------------- Inc NumRecsOut Begin NumRecsOut = 1 OutCSV '' 'Init' OutCSV 'Date' OutCSV 'Time' OutCSV 'Status' OutCSV 'Latitude' OutCSV 'Longitude' OutCSV 'Speed' OutCSV 'Course' OutCSV '' 'Done' End OutCSV '' 'Init' OutCSV DayMonthYear OutCSV UTCTimeOfFix OutCSV Status OutCSV NLatitude OutCSV ELongitude OutCSV SpeedOverGround 'Unquoted' OutCSV CourseOverGround 'Unquoted' OutCSV '' 'Done'




 

Parse-O-Matic Free, Basic, Business and Enterprise are data conversion tools that allow you to parse, convert, mine, import and export data files, reports, web capture, logs, legacy databases, text, CSV (comma separated; comma delimited), ASCII, EBCDIC, and almost any data format that you may have.

Copyright © 1986-2010 Pyroto, Inc. All rights reserved. Legal