CSV stands for “comma separated values” which stores data in a tabular format. A comma separates the data fields and stores the data in a text file with extension “.csv”. CSV is a simple file format to save data in a tabular form such as spreadsheet or database.
- CSV files can be used with any spreadsheet application, such as Microsoft Excel, Google Spreadsheets or Open Office.
- The only difference from other spreadsheet file types is that it can only have a single sheet in a file and it can not save cell, column, or row styling, and formulas for different calculations.
In the programming world, Microsoft Excel is widely used to import/export data in different forms such as tables, charts, graphs, etc. There are a lot of libraries available which can read, write, convert and print spreadsheet files and the user can quickly add any of these libraries as per their requirements.
In this article, we will discuss the top 10 CSV libraries, or you can say the most useful libraries which are used in 2017.
1. CsvHelper By joshclose
- CsvHelper is a library for reading and writing CSV files.
- It is extremely fast, flexible, and easy to use.
- It also supports reading and writing of custom class objects.
For further details, you can visit http://joshclose.github.io/CsvHelper/
2. FileHelpers By marcosmeli & mcavigelli
- 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 a strongly typed .NET array.
- The library also has support to import or export data from different data storage types like Excel, Access, SqlServer, etc.
For further details, you can visit http://www.filehelpers.net/
3. ServiceStack.Text By ServiceStack
ServiceStack.Text is a .NET fastest JSON, JSV and CSV Text Serializers. ServiceStack.Text is an independent, dependency-free serialization library containing ServiceStack's core high-performance utils and text processing functionality, including:
- JSON, JSV and CSV Text Serializers
- AutoMapping Utils
- HTTP Utils
- Dump Utils
- Fast Reflection Utils
- Several String Extensions, Collection extensions, Reflection Utils and lots more.
For further details, you can visit https://github.com/ServiceStack/ServiceStack.Text/
4. FSharp.Data By tomasp
The F# Data library implements everything you need to access data in your F# applications and scripts. It contains F# type providers for working with structured file formats (CSV, HTML, JSON, and XML) and for accessing the WorldBank data. It also includes helpers for parsing CSV, HTML and JSON files and for sending HTTP requests.
This library focuses on providing a simple, mostly read-only, access to the structured documents and other data sources.
For further details, you can visit http://fsharp.github.io/FSharp.Data/
5. LinqToExcel By paulyoder
- LinqToExcel is a .Net library that allows you to query Excel spreadsheets and CSV files using the LINQ syntax.
- The default query expects the first row to be the header row containing column names that match the property names on the generic class being used. It also assumes the data to be in the worksheet named "Sheet1".
- To query a worksheet with a different name, pass the worksheet name in as an argument.
6. GemBox.Spreadsheet By GemBoxSoftware
GemBox.Spreadsheet is a .NET component that enables developers to read, write, convert and print spreadsheet files such as XLSX, XLS, ODS, CSV, HTML, PDF or XPS from their .NET applications using one simple API. GemBox.Spreadsheet requires only .NET Framework and is many times faster than Microsoft Excel automation.
- Requires only .NET Framework and much faster than Microsoft Excel automation.
- No dependency on Microsoft Excel.
- Simple and easy-to-use programming interface.
- High-quality rendering and printing.
For further details, you can visit https://www.gemboxsoftware.com/spreadsheet/overview/
7. Spire.XLS By spirecomponent
Spire.XLS for .NET is a professional .NET Excel component to enable developers to generate, write, edit and save Excel files with C# and Visual Basic. It allows developers to convert Excel to other popular formats, such as PDF, XML, HTML, CSV, Image format, etc.
Spire.XLS supports developers to export data from the database to Excel or import data from Excel to data table. With Spire.XLS for .NET, developers can create any types of ASP.NET web responses and WinForms applications to operate Excel files.
For further details, you can visit https://www.e-iceblue.com/Introduce/excel-for-net-introduce.html
- ASP.NET Core InputFormatter, OutputFormatter for IList CSV data.
- The InputFormatter and the OutputFormatter classes are used to convert the CSV data to the C# model classes.
- The LocalizationRecord class is used as the model class to import\export to and from CSV data.
9. FlatFile By forcewake
- FlatFile is an open-source and fast-working library for reading/writing plain files such as text and CSV files.
- FlatFile is a library to work with flat files (work up-to 100 times faster than FileHelpers)
For further details, you can visit https://github.com/forcewake/FlatFile
10. DevLib.Csv By nbxx
- DevLib is a highly reusable collection of components and core functionalities addressing common crosscutting concerns.
- It provides a comprehensive set of features that save development time, minimizes costs, reduces the use of precious test resources, and decrease the overall maintenance effort.
For further details, you can visit https://devlib.codeplex.com/