LinqForEEPlus 1.0.1

dotnet add package LinqForEEPlus --version 1.0.1                
NuGet\Install-Package LinqForEEPlus -Version 1.0.1                
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="LinqForEEPlus" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LinqForEEPlus --version 1.0.1                
#r "nuget: LinqForEEPlus, 1.0.1"                
#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 LinqForEEPlus as a Cake Addin
#addin nuget:?package=LinqForEEPlus&version=1.0.1

// Install LinqForEEPlus as a Cake Tool
#tool nuget:?package=LinqForEEPlus&version=1.0.1                

中文 | English

如果觉得这个库好用,请点个星星 ⭐ 支持一下!🙇‍

设计目标

本库旨在重新封装 EPPlus 4.5 的 API,使其更加易用。


使用指南

读取 Excel 示例

// 先将文件读取到内存中,避免 EPPlus 锁定 Excel 文件。
using var ms = new MemoryStream();
using (var fs = new FileStream(file.FullName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
    await fs.CopyToAsync(ms);
}

ms.Seek(0, SeekOrigin.Begin);
using ExcelPackage excel = new ExcelPackage(ms);
var ebook = new LinqForEEPlus.Book(excel.Workbook, file.FullName);

// 访问第一个 Sheet,支持 IEnumerable<Sheet> 接口,可使用 LINQ 运算符
var esheet = ebook[0];
var row = esheet[0]; // 支持 IEnumerable<Row> 接口,可使用 LINQ 运算符
var cell = esheet[rowNum, colNum]; // 注意:在 EPPlus 中,colNum 范围为 [1,+∞),第一列的 colNum 是 1 而不是 0

// 获取单元格值
var cellStr = cell.StrValue; // 返回值已进行 Trim 操作,并将 null 替换为 ""
var cellFlo = cell.Flo; // 请使用 IsFlo 检查或 TryGetFlo 方法,否则非 float 值会抛出异常

// 获取列号对应的 Excel 字母
var colLet = Sheet.GetColumnLetter(colNum); // 将列号 123 转换为 Excel 中的列号 "ABC"

常见问题

Q:为什么使用 EPPlus 4.5,而不是最新版本?
A: 1. 新版本的 EPPlus 修改了开源协议,使用不便。
2. 4.5 版本功能已足够满足需求。

Q:还会维护这个库吗?
A: 会,但更新频率不高,因为已经很久没有发现 bug 了 😀。

Q:性能如何?兼容性如何?功能如何?
A: 性能:破烂 兼容性:支持 Unity。 功能:仅支持读取操作。


如果需要更多功能或有任何建议,欢迎提交 Issue 或 PR!

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.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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.
  • .NETStandard 2.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 4,986 12/11/2022