Json con Node.js via C++

Converti Workbook Excel in JSON

L’API Aspose.Cells supporta la conversione dei fogli di calcolo in formato JSON. Per esportare il workbook in JSON, passa SaveFormat.Json come secondo parametro del metodo Workbook.save(string, SaveFormat). Puoi anche usare la classe JsonSaveOptions per specificare ulteriori impostazioni per l’esportazione del foglio di lavoro in JSON.

Il seguente esempio di codice dimostra come esportare il foglio attivo in JSON usando il membro di enumerazione SaveFormat.Json. Consulta il codice per convertire il file sorgente nel file Json di output generato dal codice come riferimento.

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "Book1.xlsx");

// Load your source workbook
const workbook = new AsposeCells.Workbook(filePath);

// Convert the workbook to json file.
workbook.save(path.join(dataDir, "book1.json"));

Argomenti avanzati