我正在尝试创建一个程序,将CSV文件转换为具有特定布局的JSON文件。你知道吗
输入(CSV)
"First Name","Last Name","Email","Total Orders","Total Spent","Average OrderValue","Date of Last Order","Customer Since","Shipping Name","Shipping Address 1","Shipping Address 2","Shipping City","Shipping Province/State","Shipping Zip","Shipping Country","Shipping Phone Number","Billing Name","Billing Address 1","Billing Address 2","Billing City","Billing Province/State","Billing Zip","Billing Country","Billing Phone Number","Tags""test","test","test@hotmail.com","1","19.95","19.95","2016-10-06 11:48:02 -0400","2016-10-06 11:48:02 -0400","test","test test","","test","","test","test","","test","test test","","test","","test","test","",""
输出(JSON)
POST https://api.myparcel.nl/shipments HTTP/1.1
Content-Type:application/vnd.shipment+json;charset=utf-8 Authorization:basic SmVzdXNDaHJpc3Rpc0xvcmQ3Nzc=
{
"data":{
"shipments":[
{
"recipient":{
"cc":"test",
"city":"test",
"street":"test",
"number":"test",
"postal_code":"test",
"person":"test",
"phone":"",
"email":"test@hotmail.com"
},
"options":{
"package_type":1,
"only_recipient":1,
"signature":1,
"return":1,
"insurance":{
"amount":50000,
"currency":"EUR"
},
"large_format":0
},
"carrier":1
},
{
"recipient":{
"cc":"test",
"city":"test",
"street":"test",
"number":"test",
"postal_code":"test",
"person":"test",
"phone":"",
"email":"test@hotmail.com"
},
"options":{
“package_type”:1,
"only_recipient":0,
"signature":0,
"return":0
},
"carrier":1
}
]
}
}
这就是我想得到的,但我还没接近。我只能得到所有的数据,我不知道如何过滤掉它,并保持一部分不变。你知道吗
也许这对你有帮助。你知道吗
结果:
相关问题 更多 >
编程相关推荐