in reply to Extract failed VS project name from build log

You could keep track of the project named in the last 'Rebuild All started' line and then use that for the next error.
my $project = ''; while (<BUILDLOG>) { if (/Project: (.+), Configuration/) { $project = $1; } if (/- (\d+) errors?, (\d+) warnings?/) { if ($1 > 0) { print "$1 errors for project $project\n"; } } }
As long as each project starts with a like like the 'Rebuild All started' line and projects are not interlaced in the file it should extract the correct project.

Replies are listed 'Best First'.
Re: Re: Extract failed VS project name from build log
by yankeeblue (Novice) on May 19, 2004 at 20:09 UTC
    Thanks for the help everyone. Sorry, I wasn't logged in when I had submitted the original post. Anyway I ended up using the code provided by Ven'Tatsu. It works great!

    I had to modify it a bit because some of the errors say "errors" and some say "error(s)", but that was pretty easy to do. I also used a bit of the code provided by McMahon to figure out the total number of projects that failed and the total that succeeded. Thanks again.....