ExcelShaper 1.0.1
dotnet add package ExcelShaper --version 1.0.1
NuGet\Install-Package ExcelShaper -Version 1.0.1
<PackageReference Include="ExcelShaper" Version="1.0.1" />
paket add ExcelShaper --version 1.0.1
#r "nuget: ExcelShaper, 1.0.1"
// Install ExcelShaper as a Cake Addin #addin nuget:?package=ExcelShaper&version=1.0.1 // Install ExcelShaper as a Cake Tool #tool nuget:?package=ExcelShaper&version=1.0.1
ExcelShaper
ExcelShaper is a .NET library designed to facilitate reading and shaping Excel files. It provides convenient methods for extracting data from Excel files based on sheet index or header names and offers custom conversion capabilities to convert Excel data into custom types.
Table of Contents
Installation
ExcelShaper is available as a NuGet package. You can install it via NuGet Package Manager or .NET CLI.
dotnet add package ExcelShaper
Usage
Reading Excel Files
By Sheet Index
string filePath = "path/to/your/excel/file.xlsx";
var data = Engine.ReadExcelFileByIndex(filePath);
By Header Names
string filePath = "path/to/your/excel/file.xlsx";
var data = Engine.ReadExcelFileByHeader(filePath);
Custom Conversion
public class Person
{
public int Index { get; set; }
public string FirstName { get; set; } = "";
//more properties
}
string filePath = "path/to/your/excel/file.xlsx";
var data = Engine.ReadExcelFileByHeader(filePath, (rowData) =>
{
return new Person
{
Age = int.Parse(rowData["age"]),
Country = rowData["country"],
//more properties
};
});
Handling Date Formats
string filePath = "path/to/your/excel/file.xlsx";
var data = Engine.ReadExcelFileByHeader(filePath, (rowData) =>
{
// Define your conversion logic here
},sheetIndex : 1,dateFormat : "dd/MM/yyyy");
Contributing
Contributions are welcome! If you encounter any bugs or have suggestions for improvements, feel free to open an issue or submit a pull request.
To contribute to ExcelShaper, follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/improvement
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/improvement
). - Create a new Pull Request.
Please make sure to follow the code style and conventions used in the project and ensure that your changes pass all tests.
License
This project is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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. |
-
net6.0
- DocumentFormat.OpenXml (>= 3.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.