Code Monkey home page Code Monkey logo

csv4cpp's Introduction

#csv4cpp Build Status

C++ CSV Data File Parser

##Requirements

  • C++ compiler [Note: only tested with gcc - see .travis.yml]

##Introduction

I wrote this function after becoming frustrated with the level of difficulty required to read in a tabled data file for use in C++ command line programs. This csv parser uses only standard (STL) C++ libraries

##Installation

git clone https://github.com/astronomerdamo/csv4cpp.git

##Usage

Feel free to copy only the csv parser function, or compile and test at will. If you choose to copy only the parser make note of the included libraries.

To compile,

g++ readcsv.cpp -o readcsv

To run using the provided data file example,

./readcsv data.csv

with output,

0.2    1.2    0.4
0.4    1.3    0.3
0.6    1.8    0.4
0.8    2.4    0.2

Or more generically,

./readcsv path_to/data.csv

Note:

  • CSV parser is not built to support comments in data file (it's on my ToDo).
  • The data file must have a constant number of columns.
  • Every value in the data file should have a numeric value.
  • The column delimiter must a single consistent character, a single space between values is ok.

csv4cpp's People

Contributors

astronomerdamo avatar

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.