這是一個有點以.json文件,我需要找資料:找到兩個字符串之間的字符串的文件
"title":
"Spring bank holiday","date":"2012-06-04","notes":"Substitute day","bunting":true},
{"title":"Queen\u2019s Diamond Jubilee","date":"2012-06-05","notes":"Extra bank holiday","bunting":true},
{"title":"Summer bank holiday","date":"2012-08-27","notes":"","bunting":true},
{"title":"Christmas Day","date":"2012-12-25","notes":"","bunting":true},
{"title":"Boxing Day","date":"2012-12-26","notes":"","bunting":true},
{"title":"New Year\u2019s Day","date":"2013-01-01","notes":"","bunting":true},
{"title":"Good Friday","date":"2013-03-29","notes":"","bunting":false},
{"title":"
該文件是更長的時間,但它是文本的一個長行。
我想,以顯示它是什麼銀行假日在某個日期之後,並且如果它涉及彩旗。 我試過grep和sed但我找不出來。 我想是這樣的:
[command] between [date] and [}] display [title] and [bunting]/[no bunting]
[title]
應該僅僅是「聖誕節」或別的東西
忘了提: 我想在bash shell實現這一點,無論是從提示或者來自一小段代碼。
那豈不是更容易映射到JSON對象(OOP語言),並從那裏走? – hovanessyan
用於Linux的命令行工具結算 - jsawk - https://github.com/micha/jsawk和JQ - HTTP://stedolan.github。io/jq/tutorial/ – hovanessyan