generated from OBJNULL/Dockerized-Rust
Added Writer w/ Console Messages to Log
This commit is contained in:
parent
bf7edc2f97
commit
1fdb88f3a8
1 changed files with 21 additions and 0 deletions
|
@ -3,10 +3,12 @@ mod action;
|
|||
mod args;
|
||||
mod parser;
|
||||
mod reader;
|
||||
mod writer;
|
||||
|
||||
use args::Arguments;
|
||||
use parser::Parser;
|
||||
use reader::Reader;
|
||||
use writer::Writer;
|
||||
|
||||
use std::io::Result;
|
||||
|
||||
|
@ -15,14 +17,33 @@ fn main() -> Result<()> {
|
|||
// Reading the Arguments
|
||||
let args = Arguments::new();
|
||||
|
||||
// Display Status
|
||||
println!("Reading PDF and extracting Text Content...");
|
||||
|
||||
// Creating a File Reader & Reading
|
||||
let reader = Reader::new(&args.file_input.clone())?;
|
||||
let text = reader.extract();
|
||||
|
||||
// Display Status
|
||||
println!("Successfully extracted Text Content!");
|
||||
println!("Parsing the PDF...");
|
||||
|
||||
// Creating a Parser to read the Text Content
|
||||
let mut parser = Parser::new(text);
|
||||
parser.start();
|
||||
|
||||
// Display Status
|
||||
println!("Successfully parsed the PDF!");
|
||||
println!("Saving to a CSV File...");
|
||||
|
||||
// Creating a Writer and saving the file
|
||||
let writer = Writer::new(&parser.transactions, args.file_output.clone());
|
||||
writer.save()?;
|
||||
|
||||
// Display Status
|
||||
println!("Sucessfully Saved to {}", args.file_output);
|
||||
println!("Thank you for using Statement Converter!");
|
||||
|
||||
// It's ok!
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue