我的 Excel 有很多資料表,我想將其轉換為 javascript/typescript 中的 Json。以下是我的 excel 資料樣本,由一個或多個空行分隔。
| 名稱 | 年齡 |
|---|---|
| 約翰 | 40 |
| 奧利維亞 | 30 |
| 工號 | 薪水 | 語言已知 |
|---|---|---|
| 43567 | 15000 | 英語、法語 |
| 98543 | 20000 | 阿拉伯人,中國人 |
我想將這些轉換為 Json。
預期輸出:
**Json for first table:**
{
"Name" : "John",
"Age" : 40
}
{
"Name" : "Olivia",
"Age" : 30
}
**Json for Second Table:**
{
"EmpId" : 43567,
"Salary" : 15000,
"LanguagesKnown" : ["English","French"]
}
{
"EmpId" : 98543,
"Salary" : 20000,
"LanguagesKnown" : ["Arab","Chinese"]
}
uj5u.com熱心網友回復:
輸出:
[
{
"0": 1,
"First Name": "Dulce",
"Last Name": "Abril",
"Gender": "Female",
"Country": "United States",
"Age": 32,
"Date": "15/10/2017",
"Id": 1562
},
{
"0": 2,
"First Name": "Mara",
"Last Name": "Hashimoto",
"Gender": "Female",
"Country": "Great Britain",
"Age": 25,
"Date": "16/08/2016",
"Id": 1582
},
{
"0": 3,
"First Name": "Philip",
"Last Name": "Gent",
"Gender": "Male",
"Country": "France",
"Age": 36,
"Date": "21/05/2015",
"Id": 2587
},
{
"0": 4,
"First Name": "Kathleen",
"Last Name": "Hanner",
"Gender": "Female",
"Country": "United States",
"Age": 25,
"Date": "15/10/2017",
"Id": 3549
},
{
"0": 5,
"First Name": "Nereida",
"Last Name": "Magwood",
"Gender": "Female",
"Country": "United States",
"Age": 58,
"Date": "16/08/2016",
"Id": 2468
},
{
"0": 6,
"First Name": "Gaston",
"Last Name": "Brumm",
"Gender": "Male",
"Country": "United States",
"Age": 24,
"Date": "21/05/2015",
"Id": 2554
},
{
"0": 7,
"First Name": "Etta",
"Last Name": "Hurn",
"Gender": "Female",
"Country": "Great Britain",
"Age": 56,
"Date": "15/10/2017",
"Id": 3598
},
{
"0": 8,
"First Name": "Earlean",
"Last Name": "Melgar",
"Gender": "Female",
"Country": "United States",
"Age": 27,
"Date": "16/08/2016",
"Id": 2456
},
{
"0": 9,
"First Name": "Vincenza",
"Last Name": "Weiland",
"Gender": "Female",
"Country": "United States",
"Age": 40,
"Date": "21/05/2015",
"Id": 6548
}
]
uj5u.com熱心網友回復:
我使用
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/401405.html
標籤:javascript 节点.js json 擅长 打字稿
下一篇:根據串列打開作業簿并運行特定的宏
