diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2017-11-23 22:03:02 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2017-11-23 22:03:02 +0200 |
commit | 817d06fc2ef4f8e258d906fad96c26f72b32c702 (patch) | |
tree | 5ba5266955d22a9d669a38c0fbb3d2f42c6f6ede /src/main.rs |
Basic functionality: parses qif files and strips T=0 entries
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..291c548 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,25 @@ +extern crate qif_parser; +use qif_parser::qif::*; +use std::io::*; + + +fn main() { + let stdin = stdin(); + let stdin_lock = stdin.lock(); + let mut lines = stdin_lock.lines(); + + let mut file = QifFile::new(lines.next().unwrap().unwrap()); + let mut next_entry = Vec::new(); + + for line_result in lines { + let line = line_result.unwrap(); + if line == String::from("^") { + file.append_non_empty(QifEntry::new(&next_entry)); + next_entry.clear(); + } else { + next_entry.push(line); + } + } + + println!("{}", file); +} |