Skip to content

Geal/rust-csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parsing CSV in Rust

Build Status

This parser is a rewrite, different from the original rust-csv, because the previous project used an old syntax. For a failed attempt to update it to current Rust, see rust-csv-legacy

    use csv;
    use std::io::mem::Memreader;

    let s = ~"a;b;c;d\r\ne;f;g;h";
    let mut parser = csv.init(~MemReader::new(s.into_bytes()));

    //default delimitor is ','
    parser.delim(';');

    for row in parser {
      println!("first element is: {}", row[0]);
    }

Installation

    $ rustpkg install github.com/Geal/rust-csv

Unit testing

Clone the project, and in its repository:

    $ rustpkg build csv && rustpkg test csv

About

A CSV parser for Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages