<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                [TOC] > Sat May 08 2021 13:28:06 GMT+0800 (GMT+08:00) WPS 不支持導入 JSON,也不支持輸出為 JSON,本章節我們來實現將單元格區域的內容輸出為 JSON。 > 為什么不是整表或者工作簿?也可以的,只是有點復雜,后續的章節會嘗試去做。我知道怎么做,只是 JSON 是很“簡單、豐富且嚴格”的文件格式,普通用戶并不總是很嚴格地去處理表格數據,這會給生成 JSON 帶來噩夢。再者性能可能是個瓶頸——怕 WPS 直接崩掉,內存可能也扛不住。 我們一個一個 JSON 模型地進行: ## 觀察 members|No_a|No_b| ---|---|--- member1|10|12 member2|12|13 > 請開始欣賞我的散裝英語…… ### byTable 基于表格 * without index of row. ```json [ {"member":"member1", "No_a":10, "No_b":12}, {"member":"member2", "No_a":12, "No_b":13} [ ``` * with index of row. ```json { "0": {"member":"member1", "No_a":10, "No_b":12}, "1": {"member":"member2", "No_a":12, "No_b":13} } ``` ### ByRowOnlyValue 基于行僅值 * withTitle 帶上標題 ```json { "0": ["members","No_a", "No_b"], "1": ["member1", 10, 12], "2": ["member2", 12, 13] } ``` * withoutTitle 不帶標題 ```json { "0": ["member1", 10, 12], "1": ["member2", 12, 13] } ``` * titleAsKeyByRow ```json { "0": {"member":"member1", "No_a":10, "No_b":12}, "1": {"member":"member2", "No_a":12, "No_b":13} } ``` ### ByColumn 基于列 * title as key without index of column. ```json { "members": ["member1","member2"], "No_a": [10,12], "No_b": [12,13] } ``` * onlyValue with index of column. ```json { "0": ["member1","member2"], "1": [10,12], "2": [12,13] } ``` * groupByValues ```json { "member1":[{"No_a":10, "No_b":12}], //... "12":[ {"member":"member1", "No_a":10, "No_b":12}, {"member":"member2", "No_a":12, "No_b":13} ], //... } ``` > JSON 可以靈活地將一個表格數據進行結構化處理。上面的例子并不是唯一解,也不僅僅這些模型,可以更簡單或更豐富。 ## 請選擇最“安全”的模型 不管你選擇何種模型將表格 JSON 化,都應該盡可能保證生成的 JSON 可以保證數據的完整性。 * 如果要體現先后順序,則應加上能體現先后順序的key或者Value。 * 盡可能避開使用“純值”構成的數組(Array),就怕一個 sort() 操作后,數據的一一對應關系全被打散,用也可以,在數組內加入能作為先后順序的值或者鍵值對。 * 最好能保證可以可逆化操作——JSON 轉表格。 > 其實你有更好的選擇,網上有很多提供 .xls/.csv 文件轉 JSON 的工具。 下一章節看代碼實現。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看