将json对象转换为csv

时间:2013-04-13 13:04:18

标签: java json export-to-csv

我需要在java环境中的csv中转换复杂的.json文件。 我已经看过了 Javascript / convert json to csv 以及Converting JSON to XLS/CSV in JavaConvert JSON format to CSV format for MS Excel以及在其中开发的应用程序,但它们不适用于我的文件,就像这个示例:

{
    "metadata": {"result_type": "recent", "iso_language_code": "it"}, 
    "created_at": "Thu Apr 04 16: 48: 29 +0000 2013", 
    "user": {
        "id": "integer", 
        "id_str": "id_str", 
        "name": "a name and a surname", 
        "screen_name": "ascreenname", 
        "location": "Roma", 
        "description": "some description ", 
        "url": "some url", 
        "entities": {
            "url": {
                "urls": [{
                    "url": "other url", 
                    "expanded_url": null, 
                    "indices": [0, 39]
                }]
            }, 
            "description": {"urls": []}
        }, 
        "notifications": null
    }, 
    "geo": null, 
    "coordinates": null, 
    "place": null, 
    "contributors": null, 
    "entities": {
        "hashtags": [
            {"text": "text", "indices": [29, 35]}, 
            {"text": "text", "indices": [36, 52]}, 
            {"text": "roma", "indices": [53, 58]}, 
            {"text": "ostiense", "indices": [59, 68]}, 
            {"text": "text", "indices": [69, 79]}, 
            {"text": "text", "indices": [80, 92]}, 
            {"text": "text", "indices": [93, 99]}
        ], 
        "urls": [
            {"url": "an url", "expanded_url": "an url", "indices": [101, 123]}
        ], 
        "user_mentions": []
    }, 
    "lang": "it"
}

0 个答案:

没有答案