Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

HELP!

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

HELP!

Postby bezmond » Thu Apr 17, 2003 3:20 am

OK, this is a bit of an interesting job for anyone who can help out...

I have a txt file which reads like this:

!GENERAL
VERSION = 1
RELOAD = 1
UPDATE = 20030417111736
CONNECTED CLIENTS = 2
CONNECTED SERVERS = 1
!CLIENTS
test:200000:test:ATC:199.999::::::::::LAN:9:11:0:0:100::::::::::::::::::20030417111655
GB_DIR:200000:ANDREW BERRY EGNX:PILOT::29.880860:-103.699770:3816:0:T/B747/F:120:EGLL:FL320:EGNX:LAN:1:1:1200:0:40:1:I:1000:1100:1:30:4:30:EGBB:TESTING!:EGLL - HON - TNT - EGNX:::::::20030417111431
!SERVERS
LAN:127.0.0.1:local:Local Windows FSD server:1


I need to read the following information out of each line and calculate a time:
The person's ID Number (200000 - the second number) and also the LAST number, "20030417111431" - which is the date in the form of YearMonthDayHourMinuteSecond - the time they connected. I need to then store this information EITHER:
until the connection is closed, OR keep writing it to the database... the only thing being physically logged for the future is the time, however the ID will be what I use to input into the correct record in the database.

Any help would be very very gratefully recieved!!

Regards,
Andrew
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK

Postby bezmond » Thu Apr 17, 2003 10:08 am

to add, I believe this data updates every 1 minute, so perhaps I could just keep adding 1 minute to the database every time it see's the person's username appear?

Andrew
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK

Postby Redcircle » Thu Apr 17, 2003 10:58 am

does the length or structure of the file ever change?
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby bezmond » Thu Apr 17, 2003 12:31 pm

the data between the :::: crap will change a lot, for example 2 values of a "PILOT" connection will change every time the client moves around the world (lattitude/longtitude)

Andrew
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK

Postby bezmond » Thu Apr 17, 2003 12:32 pm

oh, but it will still be the same layout. The number of :'s will not change
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK

Postby bezmond » Fri Apr 18, 2003 12:27 am

and to add to my original post, I need to read the word "ATC" or "PILOT" so as I can log it into the database table under the right column.

Andrew
User avatar
bezmond
Moderator
Moderator
 
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.