我有以下JSON。我希望将整个消息作为一行阅读。这里面临的挑战是在我的文件中有数千个以下这样的企业。我想知道如何用awk或sed写一个脚本,
将每组花束视为一个数据块{....},并将数据块内的所有内容写入一行(包括花括号)
{
"technology": "big data",
"message" ":"A Tale Of Two Snow Queens
It was the best of animation, it was the worst of animation. Over the next couple months, you will be able to choose for yourself which is the true Queen, and which will be the also ran. One is from #Disney, and one is produced in the frozen land of Russia; both are based on the classic tale The #SnowQueen By #HansChristianAndersen and both, interestingly enough, have just released new trailers in anticipation of their pending releases.
http://blog.bcdb.com/tale-snow-queens-5921/",
"permalink":"http://www.facebook.com/BigCartoon/posts/10151959903248792","actor_id":118050938791}
答案 0 :(得分:0)
您可以尝试这样的事情:
gawk 'BEGIN {RS="{"} {gsub("\n"," "); print}'