redshift 1.0.3

Rust library for parsing redshift files generated by the UNLOAD command.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate csv;
extern crate redshift;

use std::io;

pub fn main() {

    // parse redshift file from stdin
    let redshift_reader = redshift::reader::Reader::new(io::stdin());

    // create a writer to stdout
    let mut csv_writer = csv::Writer::from_writer(io::stdout());

    // write out each record
    for row in redshift_reader {
        csv_writer.encode(row.values).unwrap();
    }
}