Grepolis World Data and mySQL

Posted by mdshare on Feb 17, 2010 in Grepolis |

With the following command to the field names in JSON go, via sed to replace the identifiers including colon with an empty string.

Here for players.json file:

sed -i 's/"id":\|"name":\|"alliance_id":\|"points":\|"rank":\|"towns"://g' players.json

SQL syntax to load the data into a mySQL database

LOAD DATA INFILE 'players2.json' INTO TABLE players FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES STARTING BY '{' TERMINATED BY '}';

Excellent FREE hosting for your Grepolis stats project can be found here

Tags: , , , , , , ,

Reply

Copyright © 2010 cegamers.com a CE Network product All rights reserved. Theme designing by Mark Hoodia