TableReader.ExcelDataReader
0.2.4
dotnet add package TableReader.ExcelDataReader --version 0.2.4
NuGet\Install-Package TableReader.ExcelDataReader -Version 0.2.4
<PackageReference Include="TableReader.ExcelDataReader" Version="0.2.4" />
<PackageVersion Include="TableReader.ExcelDataReader" Version="0.2.4" />
<PackageReference Include="TableReader.ExcelDataReader" />
paket add TableReader.ExcelDataReader --version 0.2.4
#r "nuget: TableReader.ExcelDataReader, 0.2.4"
#:package TableReader.ExcelDataReader@0.2.4
#addin nuget:?package=TableReader.ExcelDataReader&version=0.2.4
#tool nuget:?package=TableReader.ExcelDataReader&version=0.2.4
TableReader
Class library to read table.
ExcelTableReader
ExcelTableReader is a C# class library designed to easily read specified tables from Excel files. This library allows you to choose between two open-source libraries, ClosedXml or ExcelDataReader, depending on your environment. It supports both .NET Framework (4.7.2 and later) and .NET (8.0).
Features
- Flexible Library Selection: You can choose to use either ClosedXml or ExcelDataReader for handling Excel files.
- Uses ClosedXml v0.97.0 for Excel file processing in .NET Framework environment.
- Uses ExcelDataReader v3.6 for Excel file processing in .NET Framework environment,
- Multi-Environment Support: Compatible with both .NET Framework 4.7.2+ and .NET 8.0.
- Simple Interface: Easily read specified tables from Excel files.
Usage
Using ClosedXml (C#)
Here is an example of how to use TableReader.ClosedXml
. The result is stored in the table
variable, which is an instance of System.Data.DataTable
from .NET Framework or .NET:
using System.Data;
using TableReader.ClosedXML;
using TableReader.Interface;
string testFilePath = "example.xlsx";
string sheetName = "Sheet1";
string tableName = "SampleTable"; // Specify the table name here
using var stream = new FileStream(testFilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) {
ITableReader reader = new ExcelTableReader(stream, sheetName);
DataTable table = reader.Read(tableName);
// Process the table data
Using ExcelDataReader (C#)
Similarly, using ExcelDataReader
, the result is also stored in the table
variable, which is an instance of System.Data.DataTable
:
using System.Data;
using TableReader.ExcelDataReader;
using TableReader.Interface;
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
string testFilePath = "example.xlsx";
string sheetName = "Sheet1";
string tableName = "SampleTable"; // Specify the table name here
using var stream = new FileStream(testFilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
ITableReader reader = new ExcelTableReader(stream, sheetName);
DataTable table = reader.Read(tableName);
// Process the table data
Exampels
This repository includes sample projects demonstrating the use of both TableReader.ClosedXml and TableReader.ExcelDataReader. Navigate to the Sample
directory to see these examples.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- ExcelDataReader (>= 3.7.0)
- ExcelDataReader.DataSet (>= 3.7.0)
- TableReader (>= 1.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.