首先,如果我的描述不够准确,我很抱歉,我是一个新手,我不知道有关编程的事情,所以不要犹豫告诉我,如果你需要更详细的信息,但我会尽量做到尽可能精确。JSON到CSV:如何在最终的Excel表格中添加过滤器(列)?
所以我已经下载了一堆感谢的鸣叫到Twitter的API和终端(通过Twurl)。所有的推文都在.json文件中(我用TextWrangler打开,我在Mac上),事情是当我将.json文件导出到.csv文件以便更容易地处理和分析数据时感谢Excel(或者至少是LibreOffice的Excel版本),我没有我需要的所有参数用于学习,我缺少.json文件中每个Tweet信息的“生物”部分。换句话说,在我的决赛桌上,我有一个推文ID列,一个推文作者,一个推文本身,等等......但我没有列的生物tweet作者,而这些信息显示在.json文件中。所以我的问题是:是否有代码或任何可以让我有更多的列显示我的最终.csv表中的基本.json文件中存在更多信息?
同样,这可能不是很清楚,所以不要犹豫,如果你需要我强调一个特定的点告诉我。
在此先感谢您的任何见解,我真的需要这方面的帮助,这是一个我需要继续为我的博士学习的研究项目,所以任何帮助都将非常值得欢迎!
编辑:作为一个例子,这里是我在原来以.json文件有一个推特数据的样本:
{
"created_at": "Mon Apr 28 09:00:40 +0000 2014",
"id": 460705144846712800,
"id_str": "460705144846712832",
"text": "Work can suck a dick today",
"source": "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
"in_reply_to_user_id_str": null,
"in_reply_to_screen_name": null,
"user": {
"id": 253350311,
"id_str": "253350311",
"name": "JEEEZUS",
"screen_name": "Maxi_Flex",
"location": "Southchestershire",
"url": "http://www.soundcloud.com/maxi_flex",
"description": "Jazz Personality.G Mentality.",
"protected": false,
"followers_count": 457,
"friends_count": 400,
"listed_count": 1,
"created_at": "Thu Feb 17 02:08:57 +0000 2011",
"favourites_count": 1229,
"utc_offset": null,
"time_zone": null,
"geo_enabled": true,
"verified": false,
"statuses_count": 13661,
"lang": "en",
"contributors_enabled": false,
"is_translator": false,
"is_translation_enabled": false,
"profile_background_color": "08ABFC",
"profile_background_image_url": "http://pbs.twimg.com/profile_background_images/444297891977244672/Z1BkfCFB.jpeg",
"profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/444297891977244672/Z1BkfCFB.jpeg",
"profile_background_tile": true,
"profile_image_url": "http://pbs.twimg.com/profile_images/454073282778902529/gCGicDBH_normal.jpeg",
"profile_image_url_https": "https://pbs.twimg.com/profile_images/454073282778902529/gCGicDBH_normal.jpeg",
"profile_banner_url": "https://pbs.twimg.com/profile_banners/253350311/1392339276",
"profile_link_color": "FA05F2",
"profile_sidebar_border_color": "FFFFFF",
"profile_sidebar_fill_color": "DDEEF6",
"profile_text_color": "333333",
"profile_use_background_image": true,
"default_profile": false,
"default_profile_image": false,
"following": null,
"follow_request_sent": null,
"notifications": null
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"retweet_count": 0,
"favorite_count": 0,
"entities": {
"hashtags": [],
"symbols": [],
"urls": [],
"user_mentions": []
},
"favorited": false,
"retweeted": false,
"filter_level": "medium",
"lang": "en"
}
所以在最后的csv文件,我有一些信息我上面提到,但我需要在csv文件中添加每个字符串的“描述”部分(粗体)。任何帮助,将不胜感激!
您可以发布一些示例JSON –
感谢您的支持,所以下面是一个字符串示例,表示我的json文件中包含一条推文的数据: – MitchBuchanon
好吧,我没有足够的空间在评论中发布样本的示例,所以我将编辑我的原始帖子... – MitchBuchanon