ByteScout Spreadsheet SDK – C# – Convert XLS to TXT

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Convert XLS to TXT

ByteScout Spreadsheet SDK – C# – Convert XLS to TXT

Program.cs

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Bytescout.Spreadsheet;
using System.Diagnostics;

namespace Converting_XLS_to_TXT
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create new Spreadsheet from SimpleReport.xls file
            Spreadsheet document = new Spreadsheet();
	document.LoadFromFile("SimpleReport.xls");

            // delete output file if exists already
            if (File.Exists("SimpleReport.txt")){
                File.Delete("SimpleReport.txt");
            }

           // save into TXT 
           document.Workbook.Worksheets[0].SaveAsTXT("SimpleReport.txt");

            // open output document in default viewer
           Process.Start("SimpleReport.txt");

        }
    }
}


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next