Export To JSON | C#Bytescout Spreadsheet SDK

Export To JSON | C#

Program.cs:

C#
using System.Diagnostics;
using System.IO;
using Bytescout.Spreadsheet;

namespace ExportToJSON
{
    class Program
    {
        static void Main(string[] args)
        {
            using (Spreadsheet spreadsheet = new Spreadsheet())
            {
                // Load document
                spreadsheet.LoadFromFile("Table.xls");

                // Export first worksheet to JSON format
                string jsonString = spreadsheet.ExportToJSON(0);

                // Write JSON string to file
                File.WriteAllText("exported.json.txt", jsonString);

                // Open the result file in default associated application
                Process.Start("exported.json.txt");
            }
        }
    }
}