<commit_before># Tabular data reader/writer

[![Build Status](https://travis-ci.org/arjantop/rust-tabular.png?branch=master)](https://travis-ci.org/arjantop/rust-tabular)

Reading and writing of tabular data.

- DSV (Delimiter-separated values): CSV (comma-separated values), TSV (tab-separated values)
- Fixed width: formats with columns of fixed width

```
git clone https://github.com/arjantop/rust-tabular
cd rust-tabular
make
```

## Documentation

API documentation on [rust-ci.org](http://www.rust-ci.org/arjantop/rust-tabular/doc/tabular/)<commit_msg>Added examples to README<commit_after># Tabular data reader/writer

[![Build Status](https://travis-ci.org/arjantop/rust-tabular.png?branch=master)](https://travis-ci.org/arjantop/rust-tabular)

Reading and writing of tabular data.

- DSV (Delimiter-separated values): CSV (comma-separated values), TSV (tab-separated values)
- Fixed width: formats with columns of fixed width

```
git clone https://github.com/arjantop/rust-tabular
cd rust-tabular
make
```

## Example

Reading CSV data:
```rust
use std::io::BufferedReader;
use std::io::File;

use tabular::dsv::{read_rows, CSV};

let path = Path::new("file.csv");
let mut file = BufferedReader::new(File::open(&path));
for row in read_rows(CSV, file) {
    println!("row = {}", row)
}
```

Reading fixed-length column data:
```rust
use std::io::BufferedReader;
use std::io::File;

use tabular::fixed::{Config, Newline, LF, ColumnConfig, Left, Right, read_rows};

let path = Path::new("file.csv");
let mut file = BufferedReader::new(File::open(&path));

let config = Config {
    columns: vec!(ColumnConfig {width: 5, pad_with: ' ', justification: Left},
                  ColumnConfig {width: 9, pad_with: '-', justification: Right}),
    line_end: Newline(LF)
};

for row in read_rows(config, file) {
    println!("row = {}", row)
}
```

## Documentation

API documentation on [rust-ci.org](http://www.rust-ci.org/arjantop/rust-tabular/doc/tabular/)
{'fraction_non_alphanumeric': 0.16411824668705402, 'fraction_numerical': 0.0010193679918450561, 'mean_word_length': 4.930513595166163, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2906928', 'n_tokens_mistral': 682, 'n_tokens_neox': 670, 'n_words': 157}