Ninjanaut.ExcelReader 1.0.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Ninjanaut.ExcelReader --version 1.0.0
NuGet\Install-Package Ninjanaut.ExcelReader -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ninjanaut.ExcelReader" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ninjanaut.ExcelReader --version 1.0.0
#r "nuget: Ninjanaut.ExcelReader, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Ninjanaut.ExcelReader as a Cake Addin
#addin nuget:?package=Ninjanaut.ExcelReader&version=1.0.0

// Install Ninjanaut.ExcelReader as a Cake Tool
#tool nuget:?package=Ninjanaut.ExcelReader&version=1.0.0

Welcome to the ExcelReader project website! ExcelReader is lightweight C# library to ease loading data from Excel file into DataTable object, based on NPOI library.

Installation

from nuget package manager console

PM> Install-Package Ninjanaut.ExcelReader

from command line

> dotnet add package Ninjanaut.ExcelReader
Version Targets
1.x .NET 5

Features

Options Defaults Notes
Supports xsl, xlsx and xlsm formats Format xlsx
Loading via sheet position or name SheetIndex or SheetName SheetIndex = 0
Skip top rows HeaderRowIndex 0
Remove empty rows RemoveEmptyRows true
Allow duplicate columns AllowDuplicateColumns true Duplicated column will be loaded as <column name>_<guid>
Limit max columns to load MaxColumns null

Usage

using Ninjanaut.IO;

var datatable = ExcelReader.ToDataTable(@"C:\FooExcel.xlsx");

or with options argument (the default settings)

using Ninjanaut.IO;

var datatable = ExcelReader.ToDataTable(@"C:\FooExcel.xlsx", new() {
                    Format = ExcelReaderFormat.Xlsx,
                    SheetIndex = 0,
                    SheetName = null,
                    HeaderRowIndex = 0,
                    RemoveEmptyRows = true,
                    AllowDuplicateColumns = true,
                    MaxColumns = null
                });

Notes

DataTable object is suitable for this purpose, because you can easily view the read data directly in Visual Studio for debug purposes, create a collection of entities from it or pass datatable as parameter directly into the SQL server stored procedure.

Contribution

If you would like to contribute to the project, please send a pull request to the dev branch.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 719 9/5/2021
1.0.0 284 8/29/2021