A fast, header-only CSV parser and writer library for modern C++ with memory-mapped file support.
csv2 is a fast, header-only CSV parsing and writing library for modern C++. It solves the problem of efficiently reading and writing large CSV files in C++ applications by using memory-mapped file I/O and providing a clean, iterator-based API.
C++ developers working with data processing, analytics, or ETL pipelines who need to handle large CSV files with high performance and minimal dependencies.
Developers choose csv2 for its exceptional speed with memory-mapped files, simple header-only integration, and modern C++ design that avoids the complexity and overhead of traditional CSV libraries.
Fast CSV parser and writer for Modern C++
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses memory-mapped file I/O for blazing-fast reads, handling multi-gigabyte CSV files in seconds as shown in detailed benchmarks with datasets up to 16 GB.
Easy integration without build dependencies—just include the header files, simplifying project setup and reducing compilation overhead.
Offers template-based customization for delimiters, quote characters, header handling, and whitespace trimming, providing flexibility for various CSV formats.
Provides a modern, range-based iterator interface for intuitive row and cell iteration, minimizing boilerplate code with C++11+ features.
The CSV writer is described as basic in the README, lacking features for streaming writes, incremental handling of large datasets, or advanced formatting options.
Performance hinges on memory-mapped files, which may fail in memory-constrained environments or with dynamically generated/streamed data not suited for mmap.
Requires C++11 or later, making it incompatible with legacy projects that cannot upgrade compilers or adhere to older standards.