GoWorkPro.CsvBuilder
1.0.0
See the version list below for details.
dotnet add package GoWorkPro.CsvBuilder --version 1.0.0
NuGet\Install-Package GoWorkPro.CsvBuilder -Version 1.0.0
<PackageReference Include="GoWorkPro.CsvBuilder" Version="1.0.0" />
paket add GoWorkPro.CsvBuilder --version 1.0.0
#r "nuget: GoWorkPro.CsvBuilder, 1.0.0"
// Install GoWorkPro.CsvBuilder as a Cake Addin #addin nuget:?package=GoWorkPro.CsvBuilder&version=1.0.0 // Install GoWorkPro.CsvBuilder as a Cake Tool #tool nuget:?package=GoWorkPro.CsvBuilder&version=1.0.0
CsvBuilder Utility Overview The CsvBuilder utility is a versatile .NET library developed by Samer Shahbaz, designed to simplify the process of creating CSV (Comma-Separated Values) files using DataTables. This utility streamlines CSV generation, allowing users to effortlessly transform tabular data into a widely compatible format.
Key Features DataSet Integration: Accepts a DataSet, facilitating the aggregation of multiple DataTables for CSV creation. Flexible Value Rendering: Supports a customizable event, ValueRenderEvent, enabling users to define custom parsers for values based on their data type (column or row). Multiple DataTable Support: Enables selective inclusion of columns from different DataTables by specifying the table index. Stream Handling: Efficiently manages memory streams to optimize CSV generation. Dispose Method: Implements the IDisposable interface for proper resource management. Usage
Constructor: Static Method for Creating CsvBuilder with Multiple DataTables:
Example #1 ICsvBuilder csvBuilder = CsvBuilder.Datasets(dataTable1, dataTable2, ...); Building CSV:
ICsvExtractor csvExtractor = csvBuilder.Build(tableIndex1, tableIndex2, ...);
Output Handling:
Obtain the CSV content as a Stream: MemoryStream csvStream = csvExtractor.GetStream(); Save the CSV content to a file: csvExtractor.SaveAsFile("filePath.csv");
Example #2:
// sample datasets var filters = dataSource.Tables[2]; var companyInformation = dataSource.Tables[1]; var actualDataSet = dataSource.Tables[0]; var details = dataSource.Tables[3];
// create an instance for builder and initialize var builder = CsvBuilder.Datasets(filters, companyInformation, actualDataSet);
//[optional] trigger evenet before value place in csv file builder.ValueRenderEvent += (value, e) ⇒ { return value; };
//generate a stream return builder.Build(2).GetStream();
Installation Install the CsvBuilder utility via NuGet Package Manager:
nuget install Samer.CsvBuilder License CsvBuilder is licensed under the MIT License.
Product | Versions 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. |
-
net5.0
- No dependencies.
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 |
---|---|---|
4.2.1 | 759 | 12/28/2023 |
4.2.0 | 657 | 12/28/2023 |
4.1.0 | 735 | 12/22/2023 |
4.0.2 | 677 | 12/20/2023 |
4.0.1 | 684 | 12/15/2023 |
4.0.0 | 724 | 12/14/2023 |
3.0.1 | 765 | 12/5/2023 |
3.0.0 | 776 | 12/1/2023 |
2.1.0 | 783 | 11/30/2023 |
2.0.0 | 765 | 11/28/2023 |
1.1.0 | 775 | 11/30/2023 |
1.0.2 | 731 | 11/27/2023 |
1.0.1 | 730 | 11/27/2023 |
1.0.0 | 754 | 11/27/2023 |