2021-03-13 23:38:20 +08:00
|
|
|
[![NuGet](https://img.shields.io/nuget/v/MiniExcel.svg)](https://www.nuget.org/packages/MiniExcel)
|
|
|
|
[![](https://img.shields.io/nuget/dt/MiniExcel.svg)](https://www.nuget.org/packages/MiniExcel)
|
|
|
|
|
2021-03-03 13:19:27 +08:00
|
|
|
|
|
|
|
### Features
|
2021-03-13 23:38:20 +08:00
|
|
|
- `Avoid large file OOM(out of memoery)` by IEnumerable Lazy `Step By Step getting one row cells` not until all rows read in memory
|
2021-03-13 23:01:25 +08:00
|
|
|
e.g: Comparison of MiniExcel Query and ExcelDataReader/EPPlus/ClosedXml of reading large Xlsx File
|
|
|
|
![miniexcel_lazy_load](https://user-images.githubusercontent.com/12729184/111034290-e5588a80-844f-11eb-8c84-6fdb6fb8f403.gif)
|
2021-03-13 23:38:20 +08:00
|
|
|
- Mini (DLL Size Only 20KB) and easy to use.
|
2021-03-03 13:19:27 +08:00
|
|
|
- Support .NET Standard 2.0/.NET 4.6/.NET 5
|
2021-03-13 23:38:20 +08:00
|
|
|
- Without any third party library dependencies
|
|
|
|
- Support dynamic/type mapping query and create by anonymous Types/DapperRows/List/Array/Set/Enumrable/DataTable/Dictionary
|
2021-03-03 13:19:27 +08:00
|
|
|
|
|
|
|
### Installation
|
|
|
|
|
|
|
|
You can install the package [from NuGet](https://www.nuget.org/packages/MiniExcel)
|
2021-03-03 13:56:32 +08:00
|
|
|
|
2021-03-13 22:39:20 +08:00
|
|
|
### Execute a query and map it to a list of dynamic objects without using head
|
|
|
|
|
|
|
|
| MiniExcel | 1 |
|
|
|
|
| -------- | -------- |
|
|
|
|
| Github | 2 |
|
|
|
|
|
|
|
|
```C#
|
|
|
|
using (var stream = File.OpenRead(path))
|
|
|
|
{
|
|
|
|
var rows = stream.Query().ToList();
|
|
|
|
|
|
|
|
Assert.Equal("MiniExcel", rows[0].A);
|
|
|
|
Assert.Equal(1, rows[0].B);
|
|
|
|
Assert.Equal("Github", rows[1].A);
|
|
|
|
Assert.Equal(2, rows[1].B);
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Execute a query with first header row
|
|
|
|
|
|
|
|
| Column1 | Column2 |
|
|
|
|
| -------- | -------- |
|
|
|
|
| MiniExcel | 1 |
|
|
|
|
| Github | 2 |
|
|
|
|
|
|
|
|
|
|
|
|
```C#
|
|
|
|
using (var stream = File.OpenRead(path))
|
|
|
|
{
|
|
|
|
var rows = stream.Query(useHeaderRow:true).ToList();
|
|
|
|
|
|
|
|
Assert.Equal("MiniExcel", rows[0].Column1);
|
|
|
|
Assert.Equal(1, rows[0].Column2);
|
|
|
|
Assert.Equal("Github", rows[1].Column1);
|
|
|
|
Assert.Equal(2, rows[1].Column2);
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2021-03-03 15:39:37 +08:00
|
|
|
### TODO
|
2021-03-03 13:56:32 +08:00
|
|
|
|
2021-03-03 15:39:37 +08:00
|
|
|
Please Check [Issues · todo](https://github.com/shps951023/MiniExcel/labels/todo)
|
|
|
|
|
|
|
|
## Release Notes
|
|
|
|
|
|
|
|
Please Check [Release Notes](https://github.com/shps951023/MiniExcel/tree/master/docs)
|