Giter Club home page Giter Club logo

Comments (2)

d99kris avatar d99kris commented on June 12, 2024

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.

d99kris avatar d99kris commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.