ByteScout Data Extraction Suite - C# - Read number format in cell with spreadsheet sdk - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Data Extraction Suite – C# – Read number format in cell with spreadsheet sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Data Extraction Suite – C# – Read number format in cell with spreadsheet sdk

How to read number format in cell with spreadsheet sdk in C# and ByteScout Data Extraction Suite

This code in C# shows how to read number format in cell with spreadsheet sdk with this how to tutorial

The sample source codes on this page shows how to read number format in cell with spreadsheet sdk in C#. ByteScout Data Extraction Suite: the set that includes 3 SDK products for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK. It can read number format in cell with spreadsheet sdk in C#.

This prolific sample source code in C# for ByteScout Data Extraction Suite contains various functions and other necessary options you should do calling the API to read number format in cell with spreadsheet sdk. Simply copy and paste in your C# project or application you and then run your app! Enjoy writing a code with ready-to-use sample C# codes.

If you want to try other source code samples then the free trial version of ByteScout Data Extraction Suite is available for download from our website. Just try other source code samples for C#.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using Bytescout.Spreadsheet; using Bytescout.Spreadsheet.Constants; using System.IO; namespace HelloWorld { class Program { static void Main(string[] args) { // Create new Spreadsheet Spreadsheet document = new Spreadsheet(); document.LoadFromFile("Data.xls"); // Get worksheet by name Worksheet worksheet = document.Workbook.Worksheets.ByName("Sample"); // Check dates for (int i = 0; i < 8; i++) { for (int j = 0; j < 2; j++) { // Set current cell Cell currentCell = worksheet.Cell(i, j); // Get format type NumberFormatType formatType = currentCell.ValueDataTypeByNumberFormatString; // Write line Console.Write("Cell({0}:{1}) type is {2}. Value : ", i, j, formatType.ToString()); switch (formatType) { case NumberFormatType.DateTime: { // Read datetime DateTime date = currentCell.ValueAsDateTime; // Write date to console output Console.Write(date.ToString()); } break; case NumberFormatType.General: { // Write value to console output Console.Write(currentCell.Value); } break; } Console.WriteLine(); } } // Close document document.Close(); Console.ReadKey(); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next