Home
We need your feedback!

Bytescout Spreadsheet SDK for .NET
Screenshots

Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample Click to view sample
Subscribe to Our Bi-Monthly Newsletter (tips, new releases, specials):
 Subscribe in a reader
 PRODUCTS  |  DOWNLOAD  |  PURCHASE  |  SUPPORT  |  TESTIMONIALS   |  NEWS  | 

Bytescout Spreadsheet SDK for .NET

Download Free Trial Buy Now More Information
Shop Safely: Bytescout Spreadsheet SDK comes with a 30-DAY UNCONDITIONAL MONEY-BACK GUARANTEE

How to convert Excel document into CSV (comma separated data) file using Bytescout Spreadsheet SDK

This source code sample shows how to convert excel XLS document into comma-separated data file (.CSV) using Bytescout Spreadsheet SDK with C# in .NET

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

Source Excel document

CSV generated from Excel document using Bytescout Spreadsheet SDK

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");
// Create new StringBuilder
StringBuilder builder = new StringBuilder();
// For each row
for (int row = 1; row <= document.Workbook.Worksheets[0].UsedRangeRowMax; row++)
{
// And column in first Worksheet
for (int col = 1; col <= document.Workbook.Worksheets[0].UsedRangeColumnMax; col++)
{
// Append cell value to StringBuilder
builder.AppendFormat("{0}\t", document.Workbook.Worksheets[0].Cell(row, col).Value);
}
// Append new line
builder.AppendLine();
}
// Save StringBuilder to file
File.WriteAllText("SimpleReport.txt", builder.ToString());
}
}
}

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

Download Free Trial Buy Now More Information
Shop Safely: Bytescout Spreadsheet SDK comes with a 30-DAY UNCONDITIONAL MONEY-BACK GUARANTEE

Documentation online: view (separate window)

First steps tutorials:

Advanced Examples:

HOME  |  CONTACT US

Copyright © ByteScout, 2003-2010. Privacy Statement
Microsoft®, Windows®, Windows 2000®, Windows Server®, Windows Vista®, Internet Explorer®, .NET Framework®, ActiveX®, Visual Basic®, Visual C#®, ASP®, ASP.NET®, Excel®, PowerPoint®, are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Adobe®, Flash® and Acrobat® are registered trademarks of Adobe Systems, Incorporated. Mozilla®, Firefox® and the Mozilla and Firefox Logos are registered trademarks of the Mozilla Foundation. Other product names or brandnames used herein are for identification purposes only and might be trademarks or registered trademarks of their respective companies. We disclaim any and all rights to those marks.