The dilema. I'm trying to figure out how to parse a .log file that I have, and only pull out the information that I find pertinent. A users name, and their Ip in the form of:
username@ip.add.res.s:port
I'd like to cut off the port, and just pull out the user@ipaddress part of it, and also cut out the rest of the file. I have no clue how to go about this. The second part: Taking what I pull, and throwing it in to a sql database. Sounds like fun doesn't it?
The third: deleting the file once it's updated the sql database w/ all the current information.
Example of log as follows:
=EAT=Morpheus@216.77.201.157:27901 connected
Suislide@63.20.39.160:27901 connected
=EAT=Morpheus entered the game
Suislide entered the game
Suislide changed name to -EAT-Riceman
-EAT-Riceman joined Eggus' Evangelists.
=EAT=Morpheus joined Eggus' Evangelists.
[DEAD] -EAT-Riceman: whassup foo
[DEAD] -EAT-Riceman:
[DEAD] -EAT-Riceman: tam 2
[DEAD] =EAT=Morpheus: nuthin
-EAT-Riceman changed to Kardinals of Krippler.
The round will begin in 20 seconds!
[DEAD] -EAT-Riceman: wanna m4 ?
[DEAD] =EAT=Morpheus: i dont care
LIGHTS...
CAMERA...
-EAT-Riceman: how come your becoming a dont care person ?
ACTION!
=EAT=Morpheus feels some heart burn thanks to -EAT-Riceman's M4 Assault Rifle
-EAT-Riceman: lets just snipe
The round is over:
Kardinals of Krippler won!
[DEAD] =EAT=Morpheus: ok i suck at m4
-EAT-Riceman: keepin it real
Example: I only want =EAT=Morpheus@216.77.201.157 from the file.
Thanks for any assistance.