Guest User

Untitled

a guest
Oct 22nd, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. library("rjson")
  2. library("RMySQL")
  3. setwd("C:\\Users\\Administrator\\Downloads\\MTGCardInfo (Magic 2012) (json)")
  4. cards <- fromJSON(paste(readLines(json_file), collapse=""))[[1]]
  5. propToTableField
  6. props = vector()
  7. for(i in 1:length(cards)){
  8. card = cards[[i]]
  9. id = card$id
  10. lang = card$lang
  11. name = card$name
  12. altart = card$altart
  13. cost = card$cost
  14. type = card$type
  15. set = card$set
  16. rarity = card$rarity
  17. power = card$power
  18. toughness = card$toughness
  19. rules = card$rules
  20. printedname = card$printedname
  21. prinedtype = card$printedtype
  22. printedrules = card$printedrules
  23. flavor = card$ flavor
  24. cardnum = card$cardnum
  25. artist = card$artist
  26. sets = card$sets
  27. #build various tables and ram them into the database chekign the row oesnt already exist and neither does the mapping.
  28.  
  29. }
Add Comment
Please, Sign In to add comment