conf2.yml
in:
type: file
path_prefix: test2.json
# stop_on_invalid_record: false
parser:
type: jsonpath
root: $
columns:
- {name: uid, type: string}
- {name: date, type: string}
- {name: url, type: string}
- {name: title, type: string}
- {name: contents, type: json}
filters:
- type: expand_json
root: "$."
json_column_name: contents
expanded_columns:
- { name: "[1][1]", type: string }
- type: rename
columns:
"[1][1]": price
out:
type: stdout
test2.json
[
{
"uid": "20170116-22621624",
"date": "2017-01-16 00:22:43 +0900",
"url": "https://www.exmaple.com/foo/bar/",
"title": "タイトル",
"contents": [
[
"foo_name",
"あいう"
],
[
"price",
"1000"
]
]
},
{
"uid": "20170116-22621624-2",
"date": "2017-01-16 00:22:43 +0900",
"url": "https://www.exmaple.com/foo/bar/",
"title": "タイトル",
"contents": [
[
"名前",
"あいう"
],
[
"値段",
"千円※キーや値に日本語や半角スペース、記号が入る事もありそれを名寄せする必要がある"
]
]
}
]
*************************** 1 ***************************
uid (string) : 20170116-22621624
date (string) : 2017-01-16 00:22:43 +0900
url (string) : https://www.exmaple.com/foo/bar/
title (string) : タイトル
price (string) : 1000
*************************** 2 ***************************
uid (string) : 20170116-22621624-2
date (string) : 2017-01-16 00:22:43 +0900
url (string) : https://www.exmaple.com/foo/bar/
title (string) : タイトル
price (string) : 千円※キーや値に日本語や半角スペース、記号が入る事もありそれを名寄せする必要がある