![]() |
VOOZH | about |
dotnet add package SweetMeSoft.Files --version 1.10.141
NuGet\Install-Package SweetMeSoft.Files -Version 1.10.141
<PackageReference Include="SweetMeSoft.Files" Version="1.10.141" />
<PackageVersion Include="SweetMeSoft.Files" Version="1.10.141" />Directory.Packages.props
<PackageReference Include="SweetMeSoft.Files" />Project file
paket add SweetMeSoft.Files --version 1.10.141
#r "nuget: SweetMeSoft.Files, 1.10.141"
#:package SweetMeSoft.Files@1.10.141
#addin nuget:?package=SweetMeSoft.Files&version=1.10.141Install as a Cake Addin
#tool nuget:?package=SweetMeSoft.Files&version=1.10.141Install as a Cake Tool
Library for file manipulation.
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.
CsvHelper.EPPlus and 2003 version (.xls) with NPOI.HtmlAgilityPack.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
Below are usage examples for each supported file type.
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");
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");
Read a table from an HTML file
var streamFile = new StreamFile("path/to/file.html");
List<MyModel> records = await Html.ReadTable<MyModel>(streamFile);
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");
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");
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);
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. |
This package is not used by any NuGet packages.
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 |