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:
kdeng00
2024-06-15 16:19:10 +00:00
committed by phoenix
parent 7cc9ded225
commit 095da0e04c
3 changed files with 48 additions and 39 deletions
+13 -10
View File
@@ -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);
}
}
}