in reply to Robocopy log parsing
I feel like I'm almost there:
use warnings; use strict; my $filename = $ARGV[0]; open(INFILE, "<", $filename) or die "Cannot open $ARGV[0]"; my(@fcont) = <INFILE>; $dir =~ m/[a-z]:\\.*?\n/g; foreach $line (@fcont) { if ($line =~ m/(New File|New Dir)\s+([0-9]+|[0-9].[0-9]\s[a-z]?)\s ++(.*?\n)/g) { print join("|",$ARGV[0],$1,$dir,$2,$3); } } close( INFILE );
but of course it tells me $line and $dir requires explict package name. What am I mising? This will pull out all entries that are New Dir or New File, but I was hoping to bring down my New Dir match so that each New File had its correpondinf directory
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Robocopy log parsing
by choroba (Cardinal) on May 28, 2012 at 15:26 UTC | |
by bit5nip3r (Initiate) on May 28, 2012 at 15:45 UTC | |
by choroba (Cardinal) on May 28, 2012 at 15:53 UTC | |
by bit5nip3r (Initiate) on May 28, 2012 at 16:25 UTC | |
by ww (Archbishop) on May 28, 2012 at 19:14 UTC | |
by bit5nip3r (Initiate) on May 29, 2012 at 09:22 UTC |