Grepolis World Data and mySQL

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

Related Posts Plugin for WordPress, Blogger...
You can leave a response, or trackback from your own site.
Managed by BrowserGamesFactory and Dark Dragon Warriors Alliance