0
BEGIN {
q = "\""
FS = OFS = q ", " q
}
{
split($1, arr, ": " q)
for(i in arr) {
if(arr[i] == "name") {
gsub(q, "'", arr[i+1])
# print arr[1] ": " q arr[2], $2, $3
}
}
}
{"last_modified": {"type": "/type/datetime", "value": "2008-04-01T03:28:50.625462"}, "type": {"key": "/type/author"}, "name": "National Research Council. Committee on the Scientific and Technologic Base of Puerto Rico"s Economy.", "key": "/authors/OL2108538A", "revision": 1}
이름의 값을 큰 따옴표, 나는 단지 하나의 큰 따옴표를 대체 할이 따옴표, 모든 이중 인용 부호가 아니라 어떻게 해결할 지 말해 주시겠습니까?
Python 또는 Perl (또는 독립 실행 형)에서 적절한 JSON 구문 분석기를 사용하는 것이 좋습니다. –
가능한 중복 [도움이 필요합니다! sed 또는 awk 텍스트 바꾸기 방법] (http://stackoverflow.com/questions/3422103/need-help-sed-or-awk-how-to-replace-text) –