https://github.com/folkerkinzel/csvtools.mappings
Mappings and Type Conversions for FolkerKinzel.CsvTools (RFC 4180)
https://github.com/folkerkinzel/csvtools.mappings
csharp csv dotnet rfc-4180
Last synced: 3 months ago
JSON representation
Mappings and Type Conversions for FolkerKinzel.CsvTools (RFC 4180)
- Host: GitHub
- URL: https://github.com/folkerkinzel/csvtools.mappings
- Owner: FolkerKinzel
- License: mit
- Created: 2022-02-05T16:09:49.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-02-28T21:16:25.000Z (3 months ago)
- Last Synced: 2025-02-28T23:37:26.839Z (3 months ago)
- Topics: csharp, csv, dotnet, rfc-4180
- Language: C#
- Homepage:
- Size: 24.9 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# FolkerKinzel.CsvTools.Mappings
[](https://www.nuget.org/packages/FolkerKinzel.CsvTools.Mappings/)
[](https://github.com/FolkerKinzel/CsvTools.Mappings/blob/master/LICENSE)
[](https://stand-with-ukraine.pp.ua)## Mappings and Type Conversions for FolkerKinzel.CsvTools (RFC 4180)
[Project Reference](https://folkerkinzel.github.io/CsvTools.Mappings/reference/)This package allows:
- analyzing CSV files and CSV strings (delimiter, header row, column names, text encoding, and required options for reading non-standard CSV)
- retrieving the appropriate method arguments for exchanging CSV data with Excel
- serializing and deserializing collections of any data type
- serializing and deserializing DataTables
- to do things easily and with just a few lines of code. In addition, the package also provides the means to write high-performance code:
- It allows you to parse ultra large CSV files because only one row of the file has to be in memory at a time.
- It makes the fields of the CSV file available as `ReadOnlyMemory` instances. This avoids the allocation of numerous temporary strings.
- It allows to parse value types without any boxing and unboxing and (when using a modern .NET version) without any allocation of temporary strings.
- The `CsvOpts.DisableCaching` option allows reusing the same `CsvRecord` instance for each parsed row of the CSV file. This can avoid further allocations.(See [benchmark results](https://github.com/FolkerKinzel/CsvTools.Mappings/tree/master/src/Benchmarks/results) and the associated [benchmark code](https://github.com/FolkerKinzel/CsvTools.Mappings/tree/master/src/Benchmarks).)
### Code Examples
- [Object serialization with CSV](https://github.com/FolkerKinzel/CsvTools.Mappings/blob/master/src/Examples/ObjectSerializationExample.cs)
- [Serializing and deserializing DataTables with CSV](https://github.com/FolkerKinzel/CsvTools.Mappings/blob/master/src/Examples/DataTableExample.cs)
- [CSV data exchange with Excel](https://github.com/FolkerKinzel/CsvTools.Mappings/blob/master/src/Examples/ExcelExample.cs)
- [High performance CSV parsing](https://github.com/FolkerKinzel/CsvTools.Mappings/blob/master/src/Benchmarks/CalculationReader_Performance.cs)
- [Fastest way to write CSV](https://github.com/FolkerKinzel/CsvTools.Mappings/blob/master/src/Benchmarks/CalculationWriter_Performance.cs)
- [Using the CsvOpts.DisableCaching option](https://github.com/FolkerKinzel/CsvTools/blob/master/src/Examples/DisableCachingExample.cs)
- [Writing an own TypeConverter<T>](https://github.com/FolkerKinzel/CsvTools.Mappings/blob/master/src/Examples/Int128Converter.cs)
- [CSV serialization with MultiColumnTypeConverter<T>](https://github.com/FolkerKinzel/CsvTools.Mappings/blob/master/src/Examples/MultiColumnConverterExample.cs)