【发布时间】:2015-09-24 20:25:14
【问题描述】:
我目前有一个提供 API json 格式文件的供应商,需要将它们转换为平面文件,以便我可以将它们加载到 SQL 服务器中。下面是 JSON 文件中的一行(超过 700K+ 行中的 1 行)。
我需要从我的 C:\Users\Lumen\Documents\APIfiles_fromvendor\test.json 的目录中导入所有文件。
在我目前正在学习的过程中,任何帮助将不胜感激。
下面是示例:
{
"vendornameoutput":[
{
"stores":{
"offers":[
{
"avgRating":0.0,
"userRatings":0,
"fulfilledBy":"",
"availability":"IN_STOCK",
"listPrice":128.88,
"maxRating":0,
"salePrice":128.88,
"upcs":[
],
"imageUrl":"http://d2dddpb.JPG",
"shippingText":"This item ships free!",
"mpns":[
"723fdads32"
],
"seller":"",
"cartPrice":false,
"addOnItem":false,
"productUrl":"http://www.zoyyyyr.com",
"salesRank":0,
"usedOffers":0,
"priceHistoryAvailable":true,
"lastRecordedAt":1441326319301,
"buyBoxWinner":false,
"newOffers":0,
"sku":"212120G319514518571",
"refurbishedOffers":0,
"additionalImageUrls":[
]
},
{
"avgRating":0.0,
"userRatings":0,
"fulfilledBy":"",
"availability":"IN_STOCK",
"listPrice":128.88,
"maxRating":0,
"salePrice":128.88,
"upcs":[
],
"imageUrl":"http://d2pbmlo3fAS01.JPG",
"shippingText":"This item ships free!",
"mpns":[
"72fsdfg5332"
],
"seller":"",
"cartPrice":false,
"addOnItem":false,
"productUrl":"http://www.zddodadfaryyyo.com/i/G3198dfasa571/?category=9668",
"salesRank":0,
"usedOffers":0,
"priceHistoryAvailable":true,
"lastRecordedAt":1429844879892,
"buyBoxWinner":false,
"newOffers":0,
"sku":"ddadG3dasd198ddds571",
"refurbishedOffers":0,
"additionalImageUrls":[
]
}
],
"storeId":2656,
"storeName":"testsite",
"title":"Pump Gun Only, For Use With 1ED22 Oiler"
},
"mpns":[
"72ddd332"
],
"imageUrl":"http://d2ulldddda/Z_HJFvfo5oy.JPG",
"categoryName":"Hand Tools",
"brandName":"Ridgid",
"categoryIdPath":"10167 > 16031 > 16032",
"categoryNamePath":"Tools & Home Improvement > Power & Hand Tools > Hand Tools",
"brandId":19970,
"title":"Pump Gun Only, For Use With 1EDffsad22 Oiler",
"categoryId":16032,
"upcs":[
],
"currency":"USD",
"mpid":"0fb1f23c94c3bc7928ee72f9880a2174",
"countryCode":"US",
"lastRecordedAt":1442922991002,
"storesCount":6,
"offersCount":10,
"maxSalePrice":280.75,
"minSalePrice":128.88
}
]
}
【问题讨论】:
-
究竟是什么阻止您完成/继续编写代码?你需要什么样的帮助?您是否面临任何错误/异常/不正确的结果?
-
贴出你已经写好的代码...
-
我从另一个帖子中复制了别人的代码,但无法使其工作,所以我决定发布一个示例并寻求帮助。以下是该帖子的链接:stackoverflow.com/questions/2591098/how-to-parse-json-in-java
-
既然你给了我一个-1,这篇文章会被看到吗?