ExcelReaderMapper 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ExcelReaderMapper --version 1.0.0
NuGet\Install-Package ExcelReaderMapper -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="ExcelReaderMapper" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ExcelReaderMapper --version 1.0.0
#r "nuget: ExcelReaderMapper, 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 ExcelReaderMapper as a Cake Addin
#addin nuget:?package=ExcelReaderMapper&version=1.0.0

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

ExcelReaderMapper

Lightweight excel reader for .NET application

Build project publish to nuget

This use ExcelDataReader to read the excel file. It will read line one by one. So it optimize the memory

Installation

Download package from NuGet ExcelReaderMapper

Note for .NET CORE

By default, ExcelDataReader throws a NotSupportedException "No data is available for encoding 1252." on .NET Core.

To fix, add a dependency to the package System.Text.Encoding.CodePages and then add code to register the code page provider during application initialization (f.ex in Startup.cs):

System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);

This is required to parse strings in binary BIFF2-5 Excel documents encoded with DOS-era code pages. These encodings are registered by default in the full .NET Framework, but not on .NET Core.

Using

Create a model to mapping with datatype with DisplayAttribute to declare the excel column name

public class ExcelModel
{
    [Display(Name = "FIRST_NAME")]
    public string FirstName { get; set; }
    
    [Display(Name = "LAST_NAME")]
    public string LastNane { get; set; }
    
    [Display(Name = "AGE")]
    public int Age { get; set; }
}

Call the excelmapper object

var fileContent = File.ReadAllBytes("Example.xlsx");
var excelMapper = new MapExcelFile();
excelMapper.DateTimeFormat = new{ "yyyy-dd-MM" };
var result = excelMapper.GetDataFromExcel<ExcelModel>(fileContent);

Properties

lineOfOffset: It will offset the lines that started reading the excel file (Default = 1) DateTimeFormat: contains a array of datetime format when the columns is not a Date type in excel

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.3.3 331 11/22/2023
2.3.2 102 11/22/2023
2.3.1 1,347 5/22/2023
2.3.0 455 10/5/2022
2.2.9 445 9/20/2022
2.2.8 420 9/19/2022
2.2.7 436 9/16/2022
2.2.6 468 9/14/2022
2.2.5 409 9/12/2022
2.2.4 409 9/10/2022
2.2.3 401 9/9/2022
2.2.2 410 9/7/2022
2.2.1 406 8/30/2022
2.2.0 405 8/30/2022
2.1.0 420 8/10/2022
2.0.0 396 8/9/2022
1.0.0 431 7/30/2022