remove cruft from log line
This commit is contained in:
parent
0224e9d5b7
commit
64970a80bc
1 changed files with 8 additions and 2 deletions
10
src/main.rs
10
src/main.rs
|
@ -9,10 +9,16 @@ struct Cli {
|
|||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
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() {
|
||||
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 {
|
||||
println!("{}", line);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue