csvvy 0.0.2

a quick and dirty csv parser
Documentation
  • Coverage
  • 0%
    0 out of 6 items documented0 out of 2 items with examples
  • Size
  • Source code size: 18.95 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.43 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • hougesen/csvvy
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • hougesen

csvvy

csvvy is a very simple csv parser that you most likely shouldn't use.

If you for some weird reason want to use it; it should be pretty straightforward:

fn do_something() {
    let input = "
name, height, weight
Mads, 174, 62.5
Oliver, 195, 86.1
Tobias, 182, 90
Casper, 170, 56
";

    let separator = ',';

    let rows: Vec<std::collections::HashMap<String, CsvValue>> =
        csvvy::parse_csv(&input, separator);

    for row in rows {
        match row.get("height") {
            Some(CsvValue::Float(num)) => {
                // Do something
            }

            Some(CsvValue::Integer(num)) => {
                // Do something else
            }

            Some(CsvValue::Text(_)) | None => {
                // ignore
            }
        };
    }
}