百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

rapidcsv

> 编程语言
开源

C++ CSV 解析器库

1.1K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

C++ CSV 解析器库

Rapidcsv

Linux Mac Windows
Rapidcsv 是一款易于使用的 C++ CSV 解析器库。它支持 C++11 (以及
稍后),仅包含头文件,并附带基本的测试套件。
图书馆被列入了这本书中
C++20 适用于程序员。
示例用法
===========
这里有一个简单的示例,读取 CSV 文件并将 'Close' 列作为
浮点数向量。
colhdr.csv 内容:
Open,High,Low,Close,Volume,Adj Close
64.529999,64.800003,64.139999,64.620003,21705200,64.620003
64.419998,64.730003,64.190002,64.620003,20235200,64.620003
64.330002,64.389999,64.050003,64.360001,19259700,64.360001
64.610001,64.949997,64.449997,64.489998,19384900,64.489998
64.470001,64.690002,64.300003,64.620003,21234600,64.620003

ex001.cpp 文件内容:

…

cpp rapidcsv::Document doc("file.csv", rapidcsv::LabelParams()); rapidcsv::SeparatorParams(), new rapidcsv::ConverterParams(true));


Check if a Column Exists
------------------------
Rapidcsv provides the methods GetColumnNames() and GetRowNames() to retrieve
the column and row names. To check whether a particular column name exists
one can for example do:

cpp rapidcsv::Document doc("file.csv"); std::vector = doc.GetColumnNames(); bool columnExists = (std::find(columnNames.begin(), columnNames.end(), "A") != columnNames.end());


Handling Quoted Cells
---------------------
By default rapidcsv automatically dequotes quoted cells (i.e. removes the encapsulating
`"` characters from `"example quoted cell"`). This functionality may be disabled by
passing `pAutoQuote = false` in `SeparatorParams`, example:

cpp rapidcsv::Document doc("file.csv", rapidcsv::LabelParams()); rapidcsv::SeparatorParams(',/* pSeparator */, false

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++c-plus-plusc-plus-plus-11csv-parserlibrary

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言