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


February 17th, 2010
mdshare
Posted in
Tags: 


