Comments (2)
Hi @matwey - I'm not at a computer now so I haven't checked your issue in detail, but I suspect the use case is similar to #93 which was deemed out of scope for rapidcsv. There was some proposed changes in that issue which you could take a look at if you like, until I review your issue properly.
from rapidcsv.
Hi again - so I can confirm the code in #93 should word for your use-case.
You can use the patch consecutive-separators.patch.txt
attached in this issue to apply to rapidcsv:
git apply consecutive-separators.patch.txt
and then use the mIgnoreConsecutive option like this:
#include <iostream>
#include <vector>
#include "rapidcsv.h"
int main()
{
rapidcsv::LabelParams labelParams(-1, -1);
rapidcsv::SeparatorParams separatorParams;
separatorParams.mSeparator = ' ';
separatorParams.mIgnoreConsecutive = true;
rapidcsv::Document doc("test.dat", labelParams, separatorParams);
std::vector<float> col = doc.GetColumn<float>(1);
for (auto& val : col)
{
std::cout << "Value: " << val << std::endl;
}
}
Having reviewed this use case before it was concluded that this was out of scope for rapidcsv, so there are no current plans to integrate this patch into rapidcsv.
Feel free to re-open this issue if you have any follow-up questions.
from rapidcsv.
Related Issues (20)
- Removing Columns HOT 12
- std::string_view support HOT 3
- sign-conversion warnings HOT 3
- Make quoting character configurable HOT 2
- [bug] Test errors occur when running `winmake.bat` on non-utf8 default encoding platform. HOT 2
- Provide imported target "rapidcsv::rapidcsv" and config files for CMake find_package HOT 4
- [bug] Cannot run `winmake.bat` directly to configure and build the project on Windows. HOT 1
- Add documentation for using package managers vcpkg/conan to fetch rapidcsv HOT 2
- Incorrect precision in default Converter.ToStr() depending on type HOT 2
- `mNumericLocale` only considers C-locale, but not C++-locale HOT 2
- Setting cell value is not working correctly with column headers offset
- Conflict caused by `typedef SSIZE_T ssize_t;` HOT 5
- Retain UTF-8 BOM on Save
- Add two SetCell methods for consistency with GetCell HOT 1
- basic_ios::clear: iostream error HOT 4
- openSUSE 15.4 / g++ v7.5.0 build warnings
- CSV files ending with a commented line without a line-break will result in the commented line as part of the final data HOT 2
- Reading empty lines not possible HOT 2
- string contains '\n' ,but not quoted HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rapidcsv.