Jump to content

raz0rsedge

Member
  • Content Count

    2
  • Joined

  • Last visited

  • Medals

Everything posted by raz0rsedge

  1. Hi there, i'm new to this Forum, but not new to ArmA. I'm supporting ArmA since OFP and do my best spreading the word about this awesome non-arcade-military-game. I have a warfare server for CO/OA which is runnin fine, from the generated serverlog.txt I extract some stats (egrep discards useless data for me) like this: It's a linux machine and I'd like to generate some small stats tables from this textfile, therefore I've written a php-script that takes these 4 values and writes them into a MySQL-Database. Now the only thing I need is awk to generate some useable SQl syntax from this parsed serverlog file. I'm not familiar with awk, and here's the error. It generates from above values not the needed SQL syntax: SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; CREATE TABLE IF NOT EXISTS `phpkit2`.`Players` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL AUTO_INCREMENT, `customScore` int(11) NOT NULL, `killsTotal` int(11) NOT NULL, `killed` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs; INSERT INTO `Players` (`name`, `customScore`, `killsTotal`, `killed`) VALUES (1, name="Ats Puu", ^M, ), (2, customScore=1, ^M, ), (3, killsTotal=6, ^M, ), (4, killed=3, ^M, ), (5, name="Dennis2000", ^M, ), What I expected is something like this: SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; CREATE TABLE IF NOT EXISTS `phpkit2`.`Players`( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(100) character set utf8 collate utf8_bin NOT NULL default '', `customScore` int(11) NOT NULL, `killsTotal` int(11) NOT NULL, `killed` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `name` (`name`) )ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO `Players` (`name`, `customScore`, `killsTotal`, `killed`) VALUES ('Ats Puu', '1', '6', '3'), ('Peter', '2', '8', '4'); maybe someone of you guys can help getting this lil thing done, so we can make a bundle for server-owners to generate their own lil stats... Here's my faulty awk source which should be executed by a cron-job: Maybe some helpful guy can teach me how to rewrite the awk script to generate a useable SQL STATEMENT (awk -f awkscript serverlog.txt > inc.stats.php. I tried many howto's and websites to get behind the internal work of AWK, but I only understand that it's parsing the lower part of the awkscript once per line in serverlog.txt help may be apreciated, raz0rsedge http://silent-forces-clan.de/sfc/include.php?path=playerstats.php
  2. Your work looks very nice... but for the moment I'll only do a serverwide overview. Therefore the serverlog is parsed to an easier format by egrep & co. I'll update this thread if the awk thingy is solved... Thanks anyway...
×