Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Linux Programming & Scripting > shell script for gps log data inserting into mysql database

Forgot Password?
 Linux Programming & Scripting   C, Perl, PHP, Bash Scripts, anything programming or script related post in here!

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 06-24-2009   #1 (permalink)
Just Joined!
 
Join Date: Jun 2009
Posts: 3
shell script for gps log data inserting into mysql database

Hi,

I am new to linux, i want 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
gudivada213 is offline  


Reply With Quote
Old 06-24-2009   #2 (permalink)
Linux Newbie
 
Join Date: Jul 2008
Posts: 179
Are you quoting from your class assignment?
burschik is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 01:43 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2