【发布时间】:2016-04-23 00:19:11
【问题描述】:
我有一个大的 JSON 对象文件(超过 12000 行),看起来像:
{
"System": "2334",
"Id": "AP64531346-2016055553824",
"dtis": "106165099",
"Type": "Up",
... (in total, 112 lines per record)
}
{
"System": "873",
"Id": "AP24531346-20160676553824",
"dtis": "1261699",
"Type": "Up",
... (in total, 112 lines per record)
}
我想将大文件拆分成小文件,每个文件都有一个入口(112 行),并将每个文件的名称设置为“Id”的值,例如 AP64531346-2016055553824.txt 和 AP24531346-分别为20160676553824。
我尝试使用 GNU Split,但我无法将每个文件的名称设置为 Id 加 .txt。
split -l 112 ../bigfile.csv
有什么建议吗?
【问题讨论】:
标签: python json perl shell awk