How to read CSV file using Bytescout Spreadsheet for .NET without Excel

  • Home
  • /
  • Articles
  • /
  • How to read CSV file using Bytescout Spreadsheet for .NET without Excel

How to read data from CSV files using Bytescout Spreadsheet SDK in .NET application

The source code sample shows how to read data from CSV (comma separated values file) using Bytescout Spreadsheet SDK.

Download example source code: bytescoutxls_read_csv.zip (4 KB)

Source CSV file:

source CSV file

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

namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
// Create new Spreadsheet
Spreadsheet document = new Spreadsheet(“Hello_world.csv”);

// Get first worksheet
Worksheet worksheet = document.Workbook.Worksheets[0];

// Read cell value
Console.WriteLine(“Cell (0,0) value: {0}”, worksheet.Cell(0, 0).ValueAsString);

// Write message
Console.Write(“Press any key to continue…”);

// Wait user input
Console.ReadKey();
}
}
}

Download example source code: bytescoutxls_read_csv.zip (4 KB)


prev
next