我想要轉換(我是一個電源查詢轉換新手)json數據。我們的目標是合併和轉換一些json文件來創建報告。 json文件由我們的Web應用程序公開的不同Feed提供。作爲學習的一部分,我們嘗試轉換單個json文件。轉換json與電力查詢(在單個列中混合列表和記錄)
但場在我們的JSON數據的一個是爲通過功率查詢作爲記錄和列表類型的混合承認(在功率查詢該列中的一個顯示列表和記錄的混合)。
在這種情況下,我無法獲取這些訂單項的值。
任何解決這個問題的指針將是非常有益的
在此先感謝
請找到樣本JSON:
{
"@timestamp": "27-11-2015 21:31:30 PM", "thingstodo": [{
"propCode": "foo1"
},
{
"propCode": "foo2"
},
{
"propCode": "foo3",
"hours": [{
"day": "Monday-Thursday",
"time": "2:00PM - 1:00AM"
},
{
"day": "Friday-Sunday",
"time": "10:00AM - 2:00AM"
}]
},
{
"propCode": "foo4"
},
{
"propCode": "foo5",
"hours": [{
"day": "Daily",
"time": "24 Hours"
}]
},
{
"propCode": "foo6",
"hours": [{
"day": "10am - 4am",
"time": "bar & lounge area"
},
{
"day": "12pm - 4am",
"time": "gaming area"
}]
},
{
"propCode": "foo7",
"hours": [{
"day": "Daily",
"time": "11:00AM - 1:00AM"
},
{
"day": "Happy Hour Daily",
"time": "4:00PM - 6:00PM"
}]
},
{
"propCode": "foo8"
},
{
"propCode": "foo9"
},
{
"propCode": "foo10",
"hours": [{
"day": "Sun-Thu",
"time": "10:00AM - 11:00PM"
},
{
"day": "Fri & Sat",
"time": "10:00AM - 12:00AM"
}]
},
{
"propCode": "foo11",
"name": "Atlantic City Deals and Packages",
"brand": "harrahs"
},
{
"propCode": "foo12"
},
{
"propCode": "foo13",
"hours": [{
"day": "Sun-Thu",
"time": "11:00AM - 1:00AM"
},
{
"day": "Fri-Sat",
"time": "11:00AM - 2:00AM"
}]
},
{
"propCode": "foo8",
"hours": [{
"day": "Daily",
"time": "11:00AM - 2:00AM"
}]
},
{
"propCode": "foo12"
},
{
"propCode": "foo14"
},
{
"propCode": "foo14",
"hours": [{
"day": "Daily",
"time": "6:00AM - 6:00PM"
}]
},
{
"propCode": "foo12",
"hours": [{
"day": "Sunday-Thursday",
"time": "8:00AM - 6:00PM"
},
{
"day": "Friday-Saturday",
"time": "8:00AM - 7:00PM<br>"
},
{
"day": "<br>Adult Swim (21+)<br> Sunday-Thursday",
"time": "5:00PM - 6:00PM"
},
{
"day": "Friday-Saturday",
"time": "5:00PM - 7:00PM"
}]
},
{
"propCode": "foo15",
"hours": [{
"day": "Mon-Thu ",
"time": "9:00AM - 9:30PM
"
},
{
"day": "Fri-Sun ",
"time": "9:00AM - Midnight"
}]
},
{
"propCode": "foo16",
"hours": [{
"day": "Sun - Thurs:",
"time": "9:00AM - 5:00PM"
},
{
"day": "Fri - Sat:",
"time": "9:00AM - 6:00PM"
},
{
"day": "Slide",
"time": "Closed for the season"
}]
},
{
"propCode": "foo17",
"hours": [{
"day": "Friday",
"time": "10:30PM "
},
{
"day": "Saturday",
"time": "10:30PM "
}]
},
{
"propCode": "foo6"
},
{
"propCode": "foo14",
"hours": [{
"day": "Sunday - Friday",
"time": "9:00AM - 5:00PM"
},
{
"day": "Saturday",
"time": "9:00AM - 6:00PM"
}]
},
{
"propCode": "foo14",
"hours": [{
"day": "Closed for ",
"time": "Winter Season"
}]
},
{
"propCode": "foo12",
"hours": [["CLOSED"]]
},
{
"propCode": "foo18",
"hours": [{
"day": "Box Office Tue-Sat",
"time": "12:00PM - 8:00PM"
}]
},
{
"propCode": "foo19"
},
{
"propCode": "foo20",
"hours": [{
"day": "Monday - Thursday",
"time": "<br>12:00PM - 3:00AM"
},
{
"day": "Friday - Sunday",
"time": "<br>10:00AM - 3:00AM"
},
{
"day": "Live Music",
"time": ", 6:00PM - 10:00PM"
}]
},
{
"propCode": "foo6",
"hours": [{
"day": "Sunday:",
"time": "5:00PM - 1:00AM "
},
{
"day": "Monday - Thursday:",
"time": "5:00PM - 1:00AM "
},
{
"day": "Friday:",
"time": "5:00PM - 2:00AM "
},
{
"day": "Saturday:",
"time": "5:00PM - 1:00AM "
}]
},
{
"propCode": "foo16",
"hours": [{
"day": "Daily",
"time": "24 Hours"
}]
},
{
"propCode": "foo21",
"hours": [{
"day": "Mon-Sat",
"time": "10:00AM - 2:00AM"
},
{
"day": "Sun",
"time": "12:00PM - 2:00AM"
}]
},
{
"propCode": "foo10"
},
{
"propCode": "foo23",
"hours": [{
"day": "Open Daily <br>(Seasonally)",
"time": "11:00AM - 6:00PM"
}]
},
{
"propCode": "foo22",
"hours": [{
"day": "Daily",
"time": "11:00AM - 3:00AM"
}]
},
{
"propCode": "foo23",
"hours": [
{
"day": "Sun - Thurs:",
"time": "9:00AM - 5:00PM"
},
{
"day": "Fri - Sat:",
"time": "9:00AM - 6:00PM"
},
{
"day": "Slide",
"time": "Closed for the season"
}
]
}
]
}
注一此文件中的對象應該代表在excel中排成一排。
是否列表對應於記錄中的特定字段?您可以添加一個自定義列,將列表轉換爲記錄並保持記錄原樣。如果您認爲合適,您可以解包記錄。 –
如果我點擊列表,它會顯示一個字符串值,在某些情況下它也是空的。但是對於記錄,它有兩個字段「日」和「時間」(它們都包含字符串值)。該列表不對應於記錄中的任何特定字段。 – kallada
您能否包含您嘗試解析的JSON輸入示例,以及您想要將其轉換爲的輸出表? –