-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/nabijaczleweli/master'
Conflicts: Cargo.toml src/lib.rs
- Loading branch information
Showing
3 changed files
with
128 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,4 @@ term = "^0.4" | |
lazy_static = "^0.2" | ||
atty = "^0.2" | ||
encode_unicode = "^0.2" | ||
csv = "^0.14" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
extern crate prettytable; | ||
use prettytable::Table; | ||
|
||
/* | ||
Following main function will print : | ||
+---------+------+---------+ | ||
| ABC | DEFG | HIJKLMN | | ||
+---------+------+---------+ | ||
| foobar | bar | foo | | ||
+---------+------+---------+ | ||
| foobar2 | bar2 | foo2 | | ||
+---------+------+---------+ | ||
ABC,DEFG,HIJKLMN | ||
foobar,bar,foo | ||
foobar2,bar2,foo2 | ||
*/ | ||
fn main() { | ||
let table = Table::from_csv_string("ABC,DEFG,HIJKLMN\n\ | ||
foobar,bar,foo\n\ | ||
foobar2,bar2,foo2").unwrap(); | ||
table.printstd(); | ||
|
||
println!(""); | ||
println!("{}", table.to_csv(Vec::new()).unwrap().into_string()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters