#!/usr/bin/perl if (@ARGV != 1) { print "\n"; print " Usage: $0 "; print "\n"; print " generates text files for update_db from\n"; print " the tracking file log.\n"; print "\n"; print " creates -is.txt and \n"; print " -are.txt\n"; print "\n"; } foreach $file (@ARGV) { if (!open IN, $file) { print "can't open $file: $!\n"; next; } open IS, ">$file-is.txt"; open ARE, ">$file-are.txt"; while () { chomp; if (s/.*?enter: \S+ said \'(.*)\'/$1/ or s/.*?update: \'(.*?)\'; was .*/$1/) { next if /FAILED/; if (/^(.*?) is (.*)/) { print IS "$1 => $2\n"; } elsif (/^(.*?) are (.*)/) { print ARE "$1 => $2\n"; } } else { # do nothing } } close IN; close IS; close ARE; }