-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finished writing the code and had no internet access and hence final and binary release.
- Loading branch information
1 parent
73eff0b
commit beab1bf
Showing
13 changed files
with
290 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
use dotenv::dotenv; | ||
use std::error::Error; | ||
use std::fs::File; | ||
use std::io::{BufRead, BufReader}; | ||
|
||
/* | ||
Author Gaurav Sablok | ||
SLB Potsdam | ||
Date: 2025-2-12 | ||
*/ | ||
|
||
pub fn generalpattern_mapper(path: &str) -> Result<String, Box<dyn Error>> { | ||
dotenv().ok(); | ||
|
||
let file1 = std::env::var("file1").expect("file not present"); | ||
let file2 = std::env::var("file2").expect("file not found"); | ||
let file1read = File::open(file1).expect("path not found"); | ||
let file2read = File::open(file2).expect("path not found"); | ||
let bufferfile1 = BufReader::new(file1read); | ||
let bufferfile2 = BufReader::new(file2read); | ||
|
||
let mut bufferfile1_part: Vec<Vec<String>> = Vec::new(); | ||
let mut bufferfile2_part: Vec<Vec<String>> = Vec::new(); | ||
|
||
for i in bufferfile1.lines() { | ||
let line = i.expect("line not found"); | ||
if line.starts_with("plz") { | ||
continue; | ||
} else if !line.starts_with("plz") { | ||
let mutableline: Vec<_> = line.split(",").map(|x| x.to_string()).collect::<Vec<_>>(); | ||
bufferfile1_part.push(mutableline); | ||
} | ||
} | ||
|
||
for i in bufferfile2.lines() { | ||
let line = i.expect("line not found"); | ||
let mutline = line.split(",").map(|x| x.to_string()).collect::<Vec<_>>(); | ||
bufferfile2_part.push(mutline); | ||
} | ||
|
||
for i in bufferfile1_part.iter() { | ||
if i.contains(&path.to_string()) { | ||
println!("{:?}", i.join(" ").to_string()); | ||
} | ||
} | ||
|
||
for j in bufferfile2_part.iter() { | ||
if j.contains(&path.to_string()) { | ||
println!("{:?}", j.join(" ").to_string()); | ||
} | ||
} | ||
|
||
Ok("The search results have been written".to_string()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.