An open API service indexing awesome lists of open source software.

https://github.com/potatomaster101/csv

Quick and dirty CSV reader/writer
https://github.com/potatomaster101/csv

cpp17 csv-parser csv-reader header-only mit-license

Last synced: 11 months ago
JSON representation

Quick and dirty CSV reader/writer

Awesome Lists containing this project

README

          

# CSV Reader
I just want a quick and dirty header-only CSV reader in C++17.

## Usage
### Read line by line
```cpp
csv file{"file.csv"};
auto line = file.readline();
while (line) {
// do things with line.value()
line = file.readline();
}
```

### Read whole file
```cpp
csv file{"file.csv"};
for (const auto& line : file.readlines()) {
// do things with line
}
```

### Write CSV
```cpp
std::vector nums{1, 2, 3, 4, 5};
csv_write(std::cout, nums.begin(), nums.end());
```