Converte CSV in JSON con Golang tramite C++

Convertire CSV in JSON

Aspose.Cells supporta la conversione di CSV in JSON. Per questo, l’API fornisce le classi ExportRangeToJsonOptions e JsonUtility. La classe ExportRangeToJsonOptions fornisce le opzioni per esportare l’intervallo in JSON. La classe ExportRangeToJsonOptions ha le seguenti proprietà.

La classe JsonUtility esporta il JSON utilizzando le opzioni di esportazione impostate con la classe ExportRangeToJsonOptions.

Il seguente esempio di codice illustra l’uso delle classi ExportRangeToJsonOptions e JsonUtility per caricare il file CSV di origine e stampare l’output JSON nel console.

Codice di Esempio

Output della console

[
{
"id": 1,
"language": "Java",
"edition": "third",
"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",
"state": "CA",
"postalCode": 394221
}
]