Computing.Net > Forums > Linux > shellscript for gps log inserting into mysql

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

shellscript for gps log inserting into mysql

Reply to Message Icon

Name: gudivada213
Date: June 24, 2009 at 06:18:38 Pacific
OS: Linux i686
Subcategory: General
Comment:

Hi,

I am new to linux, i need shell script to insert the data from gps log.

Suppose Gps log like below,

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GPSD,R=1
$GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283, 39,20,11,165,00*71
$GPGSV,3,2,11,17,24,208,39,27,11,097,00,13,87,174, 00,19,31,042,00*70
$GPGSV,3,3,11,25,43,033,38,03,07,037,00,23,47,150, 00*44
$GPGGA,111503,0833.6323,N,07652.7685,E,1,04,1.60,1 6.69,M,-94.088,M,,*58
$GPRMC,111503,A,0833.6323,N,07652.7685,E,0.1866,25 6.540,220609,,*2A
$GPGSA,A,3,08,28,17,25,,,,,,,,,0.0,1.6,16.3*02
$GPGGA,111504,0833.6316,N,07652.7682,E,1,04,1.60,1 8.70,M,-94.088,M,,*58
-
-
--
--

When the line starting with $GPRMC and the line status having "A" after two commas, then the line details should be insert into mysql database.
line in log like below:
$GPRMC,111503,A,0833.6323,N,07652.7685,E,0.1866,25 6.540,220609,,*2A

database details:

dbname: project
tablename: gps

fields in table:
Quote:
insert above line in table like this.

time : 111503
latitude : 0833.6323,N
longitude : 07652.7685,E
speed : 0.1866
date : 220609
Steps:

Script has to check whether the line starting with $GPRMC,
if it is: then Script has to check for status "A" after two commas
............... if it is
......................... data of that line should insert in mysql db
else
................ check next line....up to terminate the log


Please help me, how to achieve this task.

Thanks,
sravan



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: shellscript for gps log inserting into mysql

inserting into mysql www.computing.net/answers/linux/inserting-into-mysql/8418.html

Samba + MySQL + W2K + RH7.1 www.computing.net/answers/linux/samba-mysql-w2k-rh71/7541.html

C-prog inserts in mySql slowly www.computing.net/answers/linux/cprog-inserts-in-mysql-slowly/15194.html