Crates.io | csv_coincidence |
lib.rs | csv_coincidence |
version | 0.1.1 |
source | src |
created_at | 2023-11-01 19:49:25.095915 |
updated_at | 2023-11-02 01:17:20.330017 |
description | Tool designed to efficiently search for and identify specific patterns within CSV files |
homepage | https://github.com/stescobedo92/csv_coincidence |
repository | https://github.com/stescobedo92/csv_coincidence |
max_upload_size | |
id | 1021701 |
size | 13,308 |
Often in the realm of data processing, CSV files are used to store tabular data, and it is important to be able to efficiently search and analyze that data this is the motivation behind the csv_coincidence
that is a library focused on the searches for partial matches in a CSV file using a customizable regular expression. This function is used to process CSV files and search for partial matches within the text strings found in the file.
use csv_coincidence::find_partial_matches;
fn main() -> Result<(), Box<dyn Error>> {
let file_path = "example.csv"; // Replace with the path of your CSV file
let regex_pattern = r"^[A-Z][a-z]*"; // Replace with the regular expression
match find_partial_matches(file_path, regex_pattern) {
Ok(matches) => {
println!("Partial Matches:");
for match_str in matches {
println!("{}", match_str);
}
}
Err(err) => {
eprintln!("Error: {}", err);
}
}
Ok(())
}
use csv_coincidence::merge_coincidence;
fn main() -> Result<(), Box<dyn Error>> {
let file_path = "example.csv"; // Replace with the path of your CSV file
let regex_pattern = r"^[A-Z][a-z]*"; // Replace with the regular expression
match merge_coincidence(file_path, regex_pattern) {
Ok(merged_data) => println!("Merge concidences:\n{}", merged_data),
Err(e) => eprintln!("Error: {}", e),
}
}
This project is licensed under the MIT license.