Convert-Excel-to-JSON
Contents
[
Hide
]
Aspose.Cells for Python via Java は、ワークブックの Json (JavaScript Object Notation) ファイルへの変換をサポートしています。
Excel ワークブックを JSON に変換
Aspose.Cells for Python via Java ライブラリが最適な決定を行うため、Excel ワークブックを JSON に変換する方法を考える必要はありません。 Aspose.Cells for Python via Java API は、スプレッドシートを JSON 形式に変換するためのサポートを提供します。ワークブックを JSON にエクスポートするには、次を渡します。SaveFormat.JSONの 2 番目のパラメータとして[Workbook.save](https://reference.aspose.com/cells/python-java/asposecells.api/workbook#save(java.lang.String,%20int) ) 方法。使用することもできますJsonSaveOptionsクラスを使用して、ワークシートを JSON にエクスポートするための追加設定を指定します。
次のコード例は、Excel ワークブックを Json にエクスポートする方法を示しています。変換するコードを参照してくださいソースファイル参照用のコードによって生成された Json ファイルに。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jpype | |
import asposecells | |
jpype.startJVM() | |
from asposecells.api import Workbook, SaveFormat | |
# Load Source Excel file | |
workbook = Workbook("sample.xlsx") | |
# Save the workbook in JSON format | |
workbook.save("sample_out.json", SaveFormat.JSON) | |
jpype.shutdownJVM() |
JsonSaveOptions クラスを使用して追加の設定を指定する次のコード例は、Excel ワークブックを Json にエクスポートする方法を示しています。変換するコードを参照してくださいソースファイル参照用のコードによって生成された Json ファイルに。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jpype | |
import asposecells | |
jpype.startJVM() | |
from asposecells.api import Workbook, SaveFormat, JsonSaveOptions, CellArea | |
# Create an options of saving the file. | |
options = JsonSaveOptions() | |
# Set the exporting range. | |
options.setExportArea(CellArea.createCellArea("B1", "C4")) | |
# Load Source Excel file | |
workbook = Workbook("sample.xlsx") | |
# Save the workbook in JSON format | |
workbook.save("sample_out.json", options) | |
jpype.shutdownJVM() |