Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library("rjson")
- library("RMySQL")
- setwd("C:\\Users\\Administrator\\Downloads\\MTGCardInfo (Magic 2012) (json)")
- cards <- fromJSON(paste(readLines(json_file), collapse=""))[[1]]
- propToTableField
- props = vector()
- for(i in 1:length(cards)){
- card = cards[[i]]
- id = card$id
- lang = card$lang
- name = card$name
- altart = card$altart
- cost = card$cost
- type = card$type
- set = card$set
- rarity = card$rarity
- power = card$power
- toughness = card$toughness
- rules = card$rules
- printedname = card$printedname
- prinedtype = card$printedtype
- printedrules = card$printedrules
- flavor = card$ flavor
- cardnum = card$cardnum
- artist = card$artist
- sets = card$sets
- #build various tables and ram them into the database chekign the row oesnt already exist and neither does the mapping.
- }
Add Comment
Please, Sign In to add comment