Enhancing file parsing (#2)
## Changes * Ignoring numerical and special characters during parsing Reviewed-on: #2 Co-authored-by: kdeng00 <kundeng94@gmail.com> Co-committed-by: kdeng00 <kundeng94@gmail.com>
This commit is contained in:
+13
-10
@@ -14,23 +14,26 @@ fn main() {
|
||||
|
||||
println!("Filepath is: {:?}", filepath);
|
||||
|
||||
let myparser = parser::parser::NumberParser
|
||||
{
|
||||
filepath: filepath.clone()
|
||||
let myparser = parser::parser::NumberParser {
|
||||
filepath: filepath.clone(),
|
||||
};
|
||||
|
||||
println!("\nDumping files");
|
||||
let rawvalues = myparser.filedump();
|
||||
|
||||
println!("\nUpdating values");
|
||||
let parsed_values = myparser.updatevalues(&rawvalues);
|
||||
|
||||
println!("\nRemoving duplicates");
|
||||
let newupdated = myparser.removedups(&parsed_values);
|
||||
|
||||
println!("\nPrinting values");
|
||||
myparser.print_values(&newupdated);
|
||||
myparser.print_values(&newupdated, true);
|
||||
|
||||
println!("\nSaving file");
|
||||
let _result = myparser.save_file(parsed_values);
|
||||
let result = myparser.save_file(parsed_values);
|
||||
|
||||
match result {
|
||||
Ok(o) => {
|
||||
println!("Successfully saved file: {:?}", o);
|
||||
}
|
||||
Err(er) => {
|
||||
println!("Error saving file: {:?}", er);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user