Groovy web console

subscribe to the feed Subscribe
to this
site

Json Groovy

Published 2 weeks ago by Sujit with tags Json Groovy
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
def string = """{"Sample_ID":"R1542-RNA","Sample_Type":"RNA","Sample_Feature":"Beer","Sex":"Male"}"""
def json = new groovy.json.JsonSlurper().parseText(string)

println json.Sample_ID
println json.Sample_Type
println json.Sample_Feature
println json.Sex

println json.keySet()
println json.entrySet()