FileHelpers is a free and easy to use .NET library to import or export data from fixed length or delimited records in files, strings or streams.
You can strongly type your flat file (fixed or delimited) by simply describing a class that maps to each record and later read or write your file as an strongly typed .NET array
The library also has support to import or export data from different data storage types like Excel, Access, SqlServer, etc.
Basic Uses of the Library
Who needs the File Helpers Library ?
In almost every project there is a need to read or write data from/to a file of a specified format.
For example, log parsing, data warehouse and OLAP applications, communication between systems, file format transformations (for example transforming from a fixed length to a CSV file).
This library aims to provide an easy and reliable way to accomplish this task.
Easy to use:The FileHelpers library is straightforward to learn and use. (see Easy Example)
Auto Converters:The library has a set of converters for common types and can be easy extended to provide custom converters. (see ConverterBase and Converter Example)
Event Support:The engines of the library contain events to make it easier to extend the behavior of the library (see Example
High Performance:The library doesn't use reflection to get or set the field values, it uses dynamic code generation
BigFileSorterYou can use the library to sort files with millon of records
FileDiffEngineProvides the ability to compare files with the same record layout (see example)
Nullable Types:The library supports Nullable types in the core (see example)
Asynchronous Mode:You can use the library to read line by line and not the whole file.
File Transform Engine:To convert files in one format to another (for example a file with CSV to a fixed length record format) (see example)
Open SourceThe library is completely free to use in any kind of development
Format AutodetectionThe library has an smart feature that based in some sample files can deduce the Record Class
WizardWe provide a Wizard app to help in the creation of the Record Class
The FileHelpers library is released under MIT License that allows the use of the code and binaries in all places, including commercial applications.
You can access the full source code of the library at GitHub github.com/MarcosMeli/FileHelpers
One of the best references that assists in the development of this library is Framework Design Libraries, a complete guide for design and programming of libraries