How to convert Excel (XLS) document into text (.TXT) file using Bytescout Spreadsheet SDK

How to convert Excel document into text (.txt) file using Bytescout Spreadsheet SDK

This source code sample shows how to convert excel XLS document into text file (.txt) using Bytescout Spreadsheet SDK with C# in .NET

Download example source code: bytescoutxls_converting_xls_to_txt.zip (8 KB)

Source Excel document

TXT file converted from source Excel XLS document

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

namespace Converting_XLS_to_TXT
{
class Program
{
static void Main(string[] args)
{
// Create new Spreadsheet from SimpleReport.xls file
Spreadsheet document = new Spreadsheet("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");

}
}
}

 

Download example source code: bytescoutxls_converting_xls_to_txt.zip (8 KB)

Filed in: Spreadsheet SDK

Tutorials: