我已將JSON結構複製粘貼到我的輸入文件的.txt文件中(我將擁有其中的一些)。如何使用BASH從JSON中提取特定文本
我在尋找之間的「開始」和「結束」的「名稱」文本,我輸入文件較大,部分我想從外觀提取這樣的:
Here: "start",
title: "Name",
type: "end",
words: "more words",
我已經嘗試以下,但它不起作用。
input.txt < sed -n '/^start",$/,/^type: "end"$/p' data > output.txt
謝謝。
http://stackoverflow.com/questions/1955505/parsing-json-with-sed-and-awk – dgig