如何通过 SHELL 脚本或命令行将大型 CSV 转换为固定记录集的 JSON 数组(100 条记录的 JSON 数组)?
例如。输入 CSV 文件:
identifier,type,locale
91617676848,MSISDN,es_ES
91652560975,MSISDN,es_ES
91636563675,MSISDN,es_ES
预期输出:
1.json (json array having 100 array records)
[
{
"identifier": "91617676848",
"type": "MSISDN",
"locale": "es_ES"
},
.
.
.
.
{
"identifier": "91652560975",
"type": "MSISDN",
"locale": "es_ES"
}
]
2.json (json array having 100 array records)
[
{
"identifier": "91636563675",
"type": "MSISDN",
"locale": "es_ES"
},
.
.
.
.
{
"identifier": "91636563999",
"type": "MSISDN",
"locale": "es_ES"
}
]