2015-09-12 41 views
0

我在想,如果有一個在線工具,可以從JSON數組得到具體的數據查詢使用密鑰數據對象JSON觀衆可以在一個JSON對象

例如,我有這樣的JSON陣列

{ "results": [ 
    { 
     "createdAt": "2015-09-02T02:03:55.765Z", 
     "name": "Clush", 
     "score": 15, 
     "updatedAt": "2015-09-12T21:03:57.773Z", 
     "userId": "5645645" 
    }, 
    { 
     "createdAt": "2015-09-06T00:17:52.225Z", 
     "name": "hello", 
     "score": 9, 
     "updatedAt": "2015-09-06T07:41:27.749Z", 
     "userId": "" 
    }, 
    { 
     "createdAt": "2015-09-08T01:21:09.970Z", 
     "name": "test", 
     "score": 50, 
     "updatedAt": "2015-09-08T01:21:14.787Z" 
    }, 
    { 
     "createdAt": "2015-09-08T01:21:20.037Z", 
     "name": "test2", 
     "score": 88, 
     "updatedAt": "2015-09-08T01:21:23.140Z" 
    }, 
    { 
     "createdAt": "2015-08-27T02:13:35.869Z", 
     "name": "Hana", 
     "score": 8, 
     "updatedAt": "2015-09-11T20:39:36.037Z", 
     "userId": "7678889" 
    } 
] } 

我只想得到下名稱字段 的值,並將其保存在單獨的文件中。

所以我的其他文件,我應該只

Clush 
hello 
test 
test2 
Hana 

我有看一些JSON觀衆,但似乎他們沒有這個 功能。

回答

1

您可以使用此服務:http://ashphy.com/JSONPathOnlineEvaluator/

在輸入文本框中輸入$。結果[*]命名

,並在評估結果窗格中,你會得到

'0' => "Clush" 
'1' => "hello" 
'2' => "test" 
'3' => "test2" 
'4' => "Hana" 
+0

好的,非常感謝.. – XDProgrammer

相關問題