ByteScout Spreadsheet SDK – C# – Read TXT (tab delimited)

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Read TXT (tab delimited)

ByteScout Spreadsheet SDK – C# – Read TXT (tab delimited)

Program.cs

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

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create new Spreadsheet
            Spreadsheet document = new Spreadsheet();
	document.LoadFromFile("Hello_World.txt", "\t"); // reading from TXT file using \t (TAB) as delimiter

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

            // Read cell value
            Console.WriteLine("Cell (0,0) value: {0}", worksheet.Cell(0, 0).ValueAsExcelDisplays);

            // Write message
            Console.Write("Press any key to continue...");

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

Hello_world.txt

Hello, world!	1	2
3	4	5


  Click here to get your Free Trial version of the SDK

prev
next