VOOZH about

URL: https://www.nuget.org/packages/SweetMeSoft.Files/

⇱ NuGet Gallery | SweetMeSoft.Files 1.10.141




👁 Image
SweetMeSoft.Files 1.10.141

dotnet add package SweetMeSoft.Files --version 1.10.141
 
 
NuGet\Install-Package SweetMeSoft.Files -Version 1.10.141
 
 
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="SweetMeSoft.Files" Version="1.10.141" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SweetMeSoft.Files" Version="1.10.141" />
 
Directory.Packages.props
<PackageReference Include="SweetMeSoft.Files" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SweetMeSoft.Files --version 1.10.141
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SweetMeSoft.Files, 1.10.141"
 
 
#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.
#:package SweetMeSoft.Files@1.10.141
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SweetMeSoft.Files&version=1.10.141
 
Install as a Cake Addin
#tool nuget:?package=SweetMeSoft.Files&version=1.10.141
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

SweetMeSoft.Files

Library for file manipulation.

Description

SweetMeSoft.Files is a library for .NET Standard 2.1 that facilitates reading and writing various file formats, such as CSV, Excel, TXT, XML, HTML and ZIP. It abstracts the complexity of underlying libraries and provides a simple and unified API for working with files.

Features

  • CSV: Reading and writing CSV files using CsvHelper.
  • Excel: Reading and writing Excel files (.xlsx) with EPPlus and 2003 version (.xls) with NPOI.
  • HTML: Reading tables from HTML files using HtmlAgilityPack.
  • TXT: Reading and writing plain text files.
  • XML: Serialization and deserialization of objects to and from XML format.
  • ZIP: File compression and decompression.

Installation

You can install the package through the NuGet Package Manager console:

Install-Package SweetMeSoft.Files

Or via the .NET CLI:

dotnet add package SweetMeSoft.Files

Usage

Below are usage examples for each supported file type.

CSV

Read a CSV file to a list of objects

using SweetMeSoft.Files;
using SweetMeSoft.Base;

// Assumes you have a StreamFile, which is a wrapper with the stream and file metadata.
var streamFile = new StreamFile("path/to/file.csv");
IEnumerable<MyModel> records = await Csv.Read<MyModel>(streamFile);

// You can also use a Stream directly.
using (var stream = File.OpenRead("path/to/file.csv"))
{
 IEnumerable<MyModel> records = await Csv.Read<MyModel>(stream);
}

Create a CSV file from a list of objects

var myList = new List<MyModel> { /* ... your data ... */ };
StreamFile csvFile = await Csv.Create(myList, "new_file.csv");

Excel

Read an Excel file (.xlsx)

var streamFile = new StreamFile("path/to/file.xlsx");
IEnumerable<MyModel> records = Excel.Read<MyModel>(streamFile);

Read an Excel 2003 file (.xls)

var streamFile = new StreamFile("path/to/file.xls");
IEnumerable<MyModel> records = Excel.Read2003File<MyModel>(streamFile);

Generate an Excel file

var myList = new List<MyModel> { /* ... your data ... */ };
StreamFile excelFile = Excel.Generate(myList, "Sheet1", "report.xlsx");

HTML

Read a table from an HTML file

var streamFile = new StreamFile("path/to/file.html");
List<MyModel> records = await Html.ReadTable<MyModel>(streamFile);

TXT

Read lines from a text file

using (var stream = File.OpenRead("path/to/file.txt"))
{
 List<string> lines = await Txt.ReadLines(stream);
}

Generate a text file

var lines = new List<string> { "Line 1", "Line 2" };
StreamFile txtFile = await Txt.Generate(lines, "my_file.txt");

XML

Read (deserialize) from XML

using (var stream = File.OpenRead("path/to/file.xml"))
{
 MyModel myObject = await Xml.Read<MyModel>(stream);
}

Create (serialize) to XML

var myObject = new MyModel { /* ... your data ... */ };
StreamFile xmlFile = Xml.Create(myObject, "my_object.xml");

ZIP

Decompress a ZIP file

using (var stream = File.OpenRead("path/to/file.zip"))
{
 List<StreamFile> uncompressedFiles = await Zip.Uncompress(stream);
}

Compress files into a ZIP

var file1 = new StreamFile(/* ... */);
var file2 = new StreamFile(/* ... */);
StreamFile zipFile = await Zip.Compress("my_file.zip", file1, file2);

Dependencies

  • CsvHelper
  • EPPlus
  • HtmlAgilityPack
  • NPOI
  • System.Linq.Async
  • SweetMeSoft.Base
  • SweetMeSoft.Tools

License

This project is distributed under the MIT license.

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 was computed.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 netstandard2.1 is compatible. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
1.10.141 534 11/30/2025
1.10.139 425 9/17/2025
1.10.138 380 9/17/2025
1.10.137 468 7/5/2025
1.10.136 229 1/16/2025
1.10.135 312 9/5/2024
1.10.134 272 8/30/2024
1.10.133 260 7/23/2024
1.10.132 280 7/10/2024
1.10.131 298 11/27/2023
1.10.130 214 11/27/2023
1.10.129 233 11/3/2023
1.10.128 229 10/3/2023
1.10.127 269 9/14/2023
1.10.126 251 8/23/2023
1.10.125 304 7/4/2023
1.10.124 325 6/1/2023
1.10.123 313 6/1/2023
1.10.122 302 6/1/2023
Loading failed