remove cruft from log line

This commit is contained in:
Paul Campbell 2024-03-28 10:57:28 +00:00
parent 0224e9d5b7
commit 64970a80bc

View file

@ -9,10 +9,16 @@ struct Cli {
fn main() -> anyhow::Result<()> { fn main() -> anyhow::Result<()> {
let cli = Cli::parse(); let cli = Cli::parse();
let re = regex::Regex::new(r"^(.*?)[\t\s]+(.*?)[\t\s]+(.*)$")?; let re = regex::Regex::new(
r"^(.*?)[\t\s]+(.*?)[\t\s]+(.*?)[\t\s]+(.*?)[\t\s]+(.*?)[\t\s]+(.*?)[\t\s]+(.*?)[\t\s]+(.*)$",
)?;
for line in read_to_string(cli.input)?.lines() { for line in read_to_string(cli.input)?.lines() {
if let Some(caps) = re.captures(line) { if let Some(caps) = re.captures(line) {
println!("{} {:5} {}", &caps[2], &caps[1], &caps[3]); // println!("{:#?}", &caps);
println!(
"{} {:5} {} {} {}",
&caps[2], &caps[1], &caps[6], &caps[7], &caps[8]
);
} else { } else {
println!("{}", line); println!("{}", line);
} }