在CentOS7使用rapidcsv.h在C++读写csv文件

  • rapidcsv.h

    github

    Rapidcsv is a C++ header-only library for CSV parsing. While the name admittedly was inspired by the rapidjson project, the objectives are not the same. The goal of rapidcsv is to be an easy-to-use CSV library enabling rapid development.

    Rapidcsv is implemented using C++11.

  • Installation

Simply copy src/rapidcsv.h to your project/include directory and include it.

  • Reading a File with Column and Row Headers

By default rapidcsv treats the first row as column headers, and the first column is treated as data.

This allows accessing columns using their labels, but not rows or cells (only using indices). In order to treat the first column as row headers one needs to use LableParams and set pRowNameIdx to 0.

  • Supported Get/Set Data Types

The internal cell representation in the Document class is using std::string and when other types are requested, standard conversion routines are used. All standard conversions are relatively straight-forward, with the exception of char for which rapidcsv interprets the cell’s (first) bytes as a character.

  • API Documentation
  1. class rapidcsv::Document
  2. class rapidcsv::SeparatorParams
  3. class rapidcsv::LabelParams
  4. class rapidcsv::ConverterParams
  5. class rapidcsv::no_converter
  6. class rapidcsv::Converter< T >
  • References

  1. Reading And Writing CSV Files With C++

你可能感兴趣的:(#,C,C++,Cython,#,Linux,CentOS,rapidcsv,csv)