如何解析完整的JSON
我想得到“text”:“#12062”这些值只在下面的json列表中如何解析完整的JSON,json,Json,我想得到“text”:“#12062”这些值只在下面的json列表中 { "language": "en", "textAngle": 0, "orientation": "Up", "regions": [ { "boundingBox": "251,234,341,436", "lines": [ { "boundingBox": "320,234,227,32", "words": [
{
"language": "en",
"textAngle": 0,
"orientation": "Up",
"regions": [
{
"boundingBox": "251,234,341,436",
"lines": [
{
"boundingBox": "320,234,227,32",
"words": [
{
"boundingBox": "320,238,52,19",
"text": "#12062"
},
{
"boundingBox": "383,245,24,16",
"text": "106"
},
{
"boundingBox": "417,248,51,18",
"text": "SILVER"
},
{
"boundingBox": "478,241,45,25",
"text": "THREAD"
},
{
"boundingBox": "532,234,15,19",
"text": "LN"
}
]
},
{
"boundingBox": "346,256,185,27",
"words": [
{
"boundingBox": "346,256,61,20",
"text": "BRANSON"
},
{
"boundingBox": "417,264,40,19",
"text": "WEST,"
},
{
"boundingBox": "469,268,16,15",
"text": "MO"
},
{
"boundingBox": "494,256,37,24",
"text": "65737"
}
]
},
{
"boundingBox": "390,277,104,22",
"words": [
{
"boundingBox": "390,277,104,22",
"text": "417-272—1112"
}
]
},
{
"boundingBox": "345,298,235,35",
"words": [
{
"boundingBox": "345,304,35,17",
"text": "9303"
},
{
"boundingBox": "408,310,32,17",
"text": "0021"
},
{
"boundingBox": "460,308,82,25",
"text": "01/10/2018"
},
{
"boundingBox": "551,298,29,22",
"text": "g:41"
}
]
},
{
"boundingBox": "256,294,25,17",
"words": [
{
"boundingBox": "256,294,25,17",
"text": "277"
}
]
},
{
"boundingBox": "257,331,335,33",
"words": [
{
"boundingBox": "257,334,16,12",
"text": "<<"
},
{
"boundingBox": "283,331,26,16",
"text": "BUY"
},
{
"boundingBox": "320,332,5,15",
"text": "1"
},
{
"boundingBox": "336,335,27,15",
"text": "GET"
},
{
"boundingBox": "374,338,5,14",
"text": "1"
},
{
"boundingBox": "391,341,87,21",
"text": "EQUAL/LESS"
},
{
"boundingBox": "487,348,43,16",
"text": "VALUE"
},
{
"boundingBox": "569,333,23,20",
"text": "Off"
}
]
},
{
"boundingBox": "256,349,290,32",
"words": [
{
"boundingBox": "256,350,35,16",
"text": "CLAY"
},
{
"boundingBox": "301,349,41,17",
"text": "4-1Nl"
},
{
"boundingBox": "355,351,25,17",
"text": "FCL"
},
{
"boundingBox": "390,356,52,19",
"text": "CLOTHS"
},
{
"boundingBox": "452,363,34,16",
"text": "SENS"
},
{
"boundingBox": "496,366,16,14",
"text": "RF"
},
{
"boundingBox": "522,362,24,19",
"text": "333"
}
]
},
{
"boundingBox": "540,375,30,21",
"words": [
{
"boundingBox": "540,375,30,21",
"text": "8.49"
}
]
},
{
"boundingBox": "479,381,8,14",
"words": [
{
"boundingBox": "479,381,8,14",
"text": "A"
}
]
},
{
"boundingBox": "292,386,151,21",
"words": [
{
"boundingBox": "292,386,52,17",
"text": "RETURN"
},
{
"boundingBox": "354,386,44,17",
"text": "VALUE"
},
{
"boundingBox": "408,390,8,14",
"text": "6"
},
{
"boundingBox": "426,391,17,16",
"text": "36"
}
]
},
{
"boundingBox": "256,401,293,30",
"words": [
{
"boundingBox": "256,404,35,17",
"text": "OLAY"
},
{
"boundingBox": "301,404,41,17",
"text": "4-1Nl"
},
{
"boundingBox": "355,404,25,16",
"text": "FCL"
},
{
"boundingBox": "390,401,53,22",
"text": "CLOiHS"
},
{
"boundingBox": "453,410,34,18",
"text": "NRML"
},
{
"boundingBox": "497,414,16,15",
"text": "RF"
},
{
"boundingBox": "523,416,26,15",
"text": "33S"
}
]
},
{
"boundingBox": "292,422,97,17",
"words": [
{
"boundingBox": "292,422,97,17",
"text": "07560904127"
}
]
},
{
"boundingBox": "541,429,34,18",
"words": [
{
"boundingBox": "541,429,34,18",
"text": "4.24"
}
]
},
{
"boundingBox": "292,440,160,17",
"words": [
{
"boundingBox": "292,440,62,17",
"text": "REGULAR"
},
{
"boundingBox": "364,440,43,17",
"text": "PRICE"
},
{
"boundingBox": "417,440,35,17",
"text": "8.49"
}
]
},
{
"boundingBox": "292,458,178,17",
"words": [
{
"boundingBox": "292,459,62,16",
"text": "REWARDS"
},
{
"boundingBox": "364,459,61,16",
"text": "SAVINGS"
},
{
"boundingBox": "435,458,35,17",
"text": "4,25"
}
]
},
{
"boundingBox": "292,476,151,17",
"words": [
{
"boundingBox": "292,476,53,17",
"text": "RETURN"
},
{
"boundingBox": "355,477,43,16",
"text": "VALUE"
},
{
"boundingBox": "408,477,35,16",
"text": "6.37"
}
]
},
{
"boundingBox": "255,494,296,19",
"words": [
{
"boundingBox": "255,494,36,16",
"text": "OLAY"
},
{
"boundingBox": "300,495,42,16",
"text": "4-1Nl"
},
{
"boundingBox": "355,495,25,16",
"text": "FCL"
},
{
"boundingBox": "390,495,53,17",
"text": "CLOTHS"
},
{
"boundingBox": "454,495,34,17",
"text": "NRML"
},
{
"boundingBox": "498,496,17,16",
"text": "RF"
},
{
"boundingBox": "525,498,26,15",
"text": "33S"
}
]
},
{
"boundingBox": "291,512,98,17",
"words": [
{
"boundingBox": "291,512,98,17",
"text": "07560904127"
}
]
},
{
"boundingBox": "543,515,34,18",
"words": [
{
"boundingBox": "543,515,34,18",
"text": "8.49"
}
]
},
{
"boundingBox": "291,530,152,18",
"words": [
{
"boundingBox": "291,530,53,16",
"text": "RETURN"
},
{
"boundingBox": "354,531,44,16",
"text": "VALUE"
},
{
"boundingBox": "408,532,35,16",
"text": "6.36"
}
]
},
{
"boundingBox": "254,546,297,21",
"words": [
{
"boundingBox": "254,546,35,16",
"text": "OLAY"
},
{
"boundingBox": "299,548,43,16",
"text": "4-1M"
},
{
"boundingBox": "354,549,26,16",
"text": "FCL"
},
{
"boundingBox": "390,549,53,17",
"text": "CLOTHS"
},
{
"boundingBox": "452,550,36,16",
"text": "SENS"
},
{
"boundingBox": "497,550,18,16",
"text": "RF"
},
{
"boundingBox": "525,550,26,17",
"text": "339"
}
]
},
{
"boundingBox": "290,565,98,18",
"words": [
{
"boundingBox": "290,565,98,18",
"text": "07560904128"
}
]
},
{
"boundingBox": "542,568,35,17",
"words": [
{
"boundingBox": "542,568,35,17",
"text": "4.24"
}
]
},
{
"boundingBox": "289,582,162,19",
"words": [
{
"boundingBox": "289,582,63,17",
"text": "REGULAR"
},
{
"boundingBox": "362,584,44,16",
"text": "PRICE"
},
{
"boundingBox": "416,585,35,16",
"text": "8.49"
}
]
},
{
"boundingBox": "289,600,180,18",
"words": [
{
"boundingBox": "289,600,63,17",
"text": "REWARDS"
},
{
"boundingBox": "362,602,62,16",
"text": "SAVINGS"
},
{
"boundingBox": "434,602,35,16",
"text": "4.25"
}
]
},
{
"boundingBox": "289,617,152,17",
"words": [
{
"boundingBox": "289,617,53,16",
"text": "RETURN"
},
{
"boundingBox": "352,619,44,15",
"text": "VALUE"
},
{
"boundingBox": "406,619,35,15",
"text": "6.37"
}
]
},
{
"boundingBox": "251,651,244,18",
"words": [
{
"boundingBox": "251,651,36,16",
"text": "OLAY"
},
{
"boundingBox": "297,652,42,16",
"text": "4-1Nl"
},
{
"boundingBox": "352,652,43,16",
"text": "FCLC"
},
{
"boundingBox": "423,653,27,16",
"text": "MFG"
},
{
"boundingBox": "460,654,35,15",
"text": "ECPN"
}
]
},
{
"boundingBox": "533,653,44,17",
"words": [
{
"boundingBox": "533,653,44,17",
"text": "-5.00"
}
]
}
]
},
{
"boundingBox": "249,702,205,159",
"lines": [
{
"boundingBox": "284,702,73,17",
"words": [
{
"boundingBox": "284,702,73,17",
"text": "SUBTOTAL"
}
]
},
{
"boundingBox": "283,719,165,17",
"words": [
{
"boundingBox": "283,719,46,16",
"text": "SALES"
},
{
"boundingBox": "339,720,27,15",
"text": "TAX"
},
{
"boundingBox": "375,721,73,15",
"text": "A-8.475%"
}
]
},
{
"boundingBox": "282,753,44,16",
"words": [
{
"boundingBox": "282,753,44,16",
"text": "TOTAL"
}
]
},
{
"boundingBox": "282,771,90,17",
"words": [
{
"boundingBox": "282,771,44,17",
"text": "DEBIT"
},
{
"boundingBox": "337,771,35,16",
"text": "CARD"
}
]
},
{
"boundingBox": "281,789,54,17",
"words": [
{
"boundingBox": "281,789,54,17",
"text": "CHANGE"
}
]
},
{
"boundingBox": "249,824,205,20",
"words": [
{
"boundingBox": "249,825,58,18",
"text": "BALANCE"
},
{
"boundingBox": "317,824,63,17",
"text": "REWARDS"
},
{
"boundingBox": "390,825,64,19",
"text": "SAVINGS"
}
]
},
{
"boundingBox": "250,842,157,19",
"words": [
{
"boundingBox": "250,845,23,16",
"text": "MFG"
},
{
"boundingBox": "281,843,53,17",
"text": "COUPON"
},
{
"boundingBox": "344,842,63,18",
"text": "SAVINGS"
}
]
}
]
},
{
"boundingBox": "530,706,46,159",
"lines": [
{
"boundingBox": "531,706,45,17",
"words": [
{
"boundingBox": "531,706,45,17",
"text": "20.46"
}
]
},
{
"boundingBox": "542,724,34,16",
"words": [
{
"boundingBox": "542,724,34,16",
"text": "1.73"
}
]
},
{
"boundingBox": "530,758,46,17",
"words": [
{
"boundingBox": "530,758,46,17",
"text": "22.19"
}
]
},
{
"boundingBox": "530,776,45,17",
"words": [
{
"boundingBox": "530,776,17,16",
"text": "22"
},
{
"boundingBox": "552,788,2,4",
"text": "."
},
{
"boundingBox": "560,777,15,16",
"text": "19"
}
]
},
{
"boundingBox": "551,795,24,16",
"words": [
{
"boundingBox": "551,795,24,16",
"text": ".00"
}
]
},
{
"boundingBox": "538,830,37,17",
"words": [
{
"boundingBox": "538,830,37,17",
"text": "8.50"
}
]
},
{
"boundingBox": "538,848,37,17",
"words": [
{
"boundingBox": "538,848,37,17",
"text": "5.00"
}
]
}
]
},
{
"boundingBox": "247,877,321,171",
"lines": [
{
"boundingBox": "249,877,316,25",
"words": [
{
"boundingBox": "249,881,38,16",
"text": "THANK"
},
{
"boundingBox": "298,880,27,16",
"text": "YOU"
},
{
"boundingBox": "336,877,26,17",
"text": "FOR"
},
{
"boundingBox": "372,878,71,20",
"text": "SHOPPING"
},
{
"boundingBox": "453,882,18,17",
"text": "AT"
},
{
"boundingBox": "481,883,84,19",
"text": "WALGREENS"
}
]
},
{
"boundingBox": "279,913,235,27",
"words": [
{
"boundingBox": "279,915,36,19",
"text": "MORE"
},
{
"boundingBox": "325,913,37,17",
"text": "WITH"
},
{
"boundingBox": "372,914,61,20",
"text": "BALANCE"
},
{
"boundingBox": "443,919,71,21",
"text": "REWARDS,"
}
]
},
{
"boundingBox": "307,931,236,24",
"words": [
{
"boundingBox": "307,931,54,18",
"text": "POINTS"
},
{
"boundingBox": "372,932,25,16",
"text": "FOR"
},
{
"boundingBox": "407,935,81,20",
"text": "SOMETHING"
},
{
"boundingBox": "499,940,44,15",
"text": "EXTRA"
}
]
},
{
"boundingBox": "270,949,282,25",
"words": [
{
"boundingBox": "270,955,9,16",
"text": "A"
},
{
"boundingBox": "290,949,53,20",
"text": "FUTURE"
},
{
"boundingBox": "353,949,77,21",
"text": "PURCHASE."
},
{
"boundingBox": "443,955,109,19",
"text": "RESTRICTIONS"
}
]
},
{
"boundingBox": "344,967,187,28",
"words": [
{
"boundingBox": "344,967,44,17",
"text": "TERMS"
},
{
"boundingBox": "398,970,25,17",
"text": "AND"
},
{
"boundingBox": "433,972,98,23",
"text": "CONDITIONS,"
}
]
},
{
"boundingBox": "247,984,247,27",
"words": [
{
"boundingBox": "247,990,41,19",
"text": "VISIT"
},
{
"boundingBox": "299,984,195,27",
"text": "WALGREENS.COM/BALANCE."
}
]
},
{
"boundingBox": "310,1020,258,28",
"words": [
{
"boundingBox": "310,1021,32,19",
"text": "RFN#"
},
{
"boundingBox": "354,1020,214,28",
"text": "1206-2219-3035-1801-1003"
}
]
}
]
},
{
"boundingBox": "252,1167,225,166",
"lines": [
{
"boundingBox": "389,1167,48,15",
"words": [
{
"boundingBox": "389,1167,48,15",
"text": "balance•"
}
]
},
{
"boundingBox": "377,1179,100,28",
"words": [
{
"boundingBox": "377,1179,100,28",
"text": "eward"
}
]
},
{
"boundingBox": "256,1242,25,21",
"words": [
{
"boundingBox": "256,1242,25,21",
"text": "SAV"
}
]
},
{
"boundingBox": "254,1255,102,44",
"words": [
{
"boundingBox": "254,1272,42,27",
"text": "POINT"
},
{
"boundingBox": "303,1255,53,29",
"text": "BALANCE"
}
]
},
{
"boundingBox": "252,1290,165,43",
"words": [
{
"boundingBox": "252,1305,50,28",
"text": "POINTS"
},
{
"boundingBox": "311,1297,14,19",
"text": "TO"
},
{
"boundingBox": "331,1290,25,18",
"text": "$10"
},
{
"boundingBox": "365,1293,52,20",
"text": "REWARD"
}
]
}
]
},
{
"boundingBox": "533,1221,58,106",
"lines": [
{
"boundingBox": "535,1221,56,32",
"words": [
{
"boundingBox": "535,1221,56,32",
"text": "u.50"
}
]
},
{
"boundingBox": "534,1269,36,21",
"words": [
{
"boundingBox": "534,1269,36,21",
"text": "8550"
}
]
},
{
"boundingBox": "533,1306,34,21",
"words": [
{
"boundingBox": "533,1306,34,21",
"text": "1450"
}
]
}
]
},
{
"boundingBox": "236,1325,325,239",
"lines": [
{
"boundingBox": "250,1325,181,43",
"words": [
{
"boundingBox": "250,1337,59,31",
"text": "BALANCE"
},
{
"boundingBox": "381,1328,34,20",
"text": "ACCT"
},
{
"boundingBox": "423,1325,8,14",
"text": "#"
}
]
},
{
"boundingBox": "527,1380,34,21",
"words": [
{
"boundingBox": "527,1380,34,21",
"text": "1300"
}
]
},
{
"boundingBox": "524,1398,27,19",
"words": [
{
"boundingBox": "524,1398,27,19",
"text": "250"
}
]
},
{
"boundingBox": "312,1399,58,32",
"words": [
{
"boundingBox": "312,1399,58,32",
"text": "BALANCES"
}
]
},
{
"boundingBox": "524,1415,35,22",
"words": [
{
"boundingBox": "524,1415,35,22",
"text": "7000"
}
]
},
{
"boundingBox": "522,1434,36,21",
"words": [
{
"boundingBox": "522,1434,36,21",
"text": "8550"
}
]
},
{
"boundingBox": "326,1476,42,22",
"words": [
{
"boundingBox": "326,1476,42,22",
"text": "12062"
}
]
},
{
"boundingBox": "237,1503,173,44",
"words": [
{
"boundingBox": "237,1512,67,35",
"text": "{OJENCE"
},
{
"boundingBox": "323,1503,87,25",
"text": "2062210120"
}
]
},
{
"boundingBox": "236,1520,174,44",
"words": [
{
"boundingBox": "236,1532,59,32",
"text": "PAYMENT"
},
{
"boundingBox": "305,1527,35,19",
"text": "FROM"
},
{
"boundingBox": "349,1520,61,18",
"text": "PRIMARY"
}
]
}
]
}
]
}
{
“语言”:“en”,
“textAngle”:0,
“方向”:“向上”,
“区域”:[
{
“边界框”:“251234341436”,
“行”:[
{
“边界框”:“320234227,32”,
“文字”:[
{
“边界框”:“320238,52,19”,
“正文”:“#12062”
},
{
“边界框”:“383245,24,16”,
“文本”:“106”
},
{
“边界框”:“417248,51,18”,
“文本”:“银色”
},
{
“边界框”:“478241,45,25”,
“文本”:“线程”
},
{
“边界框”:“532234,15,19”,
“文本”:“LN”
}
]
},
{
“边界框”:“346256185,27”,
“文字”:[
{
“边界框”:“346256,61,20”,
“文本”:“布兰森”
},
{
“边界框”:“417264,40,19”,
“文本”:“西”
},
{
“边界框”:“469268,16,15”,
“文本”:“MO”
},
{
“边界框”:“494256,37,24”,
“文本”:“65737”
}
]
},
{
“边界框”:“390277104,22”,
“文字”:[
{
“边界框”:“390277104,22”,
“文本”:“417-272-1112”
}
]
},
{
“边界框”:“345298235,35”,
“文字”:[
{
“边界框”:“345304,35,17”,
“文本”:“9303”
},
{
“边界框”:“408310,32,17”,
“文本”:“0021”
},
{
“边界框”:“460308,82,25”,
“文本”:“2018年10月1日”
},
{
“边界框”:“551298,29,22”,
“案文”:“g:41”
}
]
},
{
“边界框”:“256294,25,17”,
“文字”:[
{
“边界框”:“256294,25,17”,
“文本”:“277”
}
]
},
{
“边界框”:“257331335,33”,
“文字”:[
{
“边界框”:“257334,16,12”,
“text”:“您可以使用此代码(使用Newtonsoft.Json)
请重新格式化,使其可读,并告诉我们更多,如您使用的语言,您得到的确切错误,并向我们显示所有代码我只需要所有文本值“text”:“NOTHING”,“text”:“EXISTS”,“text”:“EXCEPT”“另外,请参考可用的url、json格式文本。您忘记回答有关您使用的语言的问题。请将您的问题包括希望您的答案使用的编程语言。此外,有关堆栈溢出的问题必须包括重现问题所需的一切(a),而不是那些必要的东西的链接。没有迹象表明OP正在使用C#或.NET。
string contents = "";//json string
using (var reader = new JsonTextReader(new StringReader(contents)))
{
while (reader.Read())
{
if (reader.Value != null)
{
if (reader.Value.ToString().Equals("#12062"))
Console.WriteLine("{0} - {1} - {2}",
reader.TokenType, reader.ValueType, reader.Value);
}
}
}