Converti CSV in JSON

Converti CSV in JSON

Aspose.Cells supporta la conversione da CSV a JSON. Per questo, API fornisceExportRangeToJsonOptionseJsonUtilityclassi. IlExportRangeToJsonOptionsclass fornisce le opzioni per l’esportazione dell’intervallo a JSON. IlExportRangeToJsonOptionsclass ha le seguenti proprietà.

IlJsonUtilityclass esporta lo JSON utilizzando le opzioni di esportazione impostate con il fileExportRangeToJsonOptionsclasse.

L’esempio di codice seguente illustra l’utilizzo diExportRangeToJsonOptionseJsonUtilityclassi per caricare il filefonte CSV filee stampa ilJSON uscita nella console.

Codice d’esempio

Uscita console

[ { “id”: 1, “language”: “Java”, “edition”: “three”, “author”: “Herbert Schildt”, “streetAddress”: 126, “city”: “San Jone”, “state”: “CA”, “postalCode”: 394221 }, { “id”: 2, “language”: “C++”, “edition”: “second”, “author”: “EAAAA”, “streetAddress”: 126, “city”: “San Jone”, “state”: “CA”, “postalCode”: 394221 }, { “id”: 3 , “language”: “.Net”, “edition”: “second”, “author”: “E.Balagurusamy”, “streetAddress”: 126, “city”: “San Jone”, " stato": “CA”, “codicepostale”: 394221 } ]