From: C. R. D. <rya...@us...> - 2004-09-29 19:15:40
|
Update of /cvsroot/dlese/logs-project In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5368 Added Files: excel_searches_no_criteria.pl excel_searches_only_criteria.pl Log Message: A couple new scripts/reports for the quality assessment project, one shows all searches with only criteria specified, and the other shows all searches with no criteria specified. --- NEW FILE --- #!/usr/bin/perl # This script parses the Excel-formatted logfiles that get generated by # excel_searches.pl, and filters out all searches where controlled # vocabulary criteria are specified, producing a report of all keyword- # only searches. Run this against the .filtered reports # # Format for use: # # excel_searches_no_criteria.pl [input_xls] [output_xls] # # Ryan Deardorff, Sep. 2004 $log_in = $ARGV[ 0 ]; $log_out = $ARGV[ 1 ]; open( IN, $log_in ) || die "Couldn't open $log_in"; $firstLine = <IN>; $firstLine =~ s/^([^\t]+\t[^\t]+\t[^\t]+\t[^\t]+\t[^\t]*).*/$1/; while ( <IN> ) { if ( /^[^\t]+\t[^\t]+\t[^\t]+\t[^\t]+\t\"[^\t]*\"(\t.*)$/ ) { if ( $1 !~ /1/ ) { $outData .= $_; } else { $emptyCount++; } } $linesCount++; } close( IN ); open( OUT, ">" . $log_out ) || die "Couldn't write to $log_out"; print OUT $firstLine . $outData; close( OUT ); print "Processed $linesCount entries, and threw out $emptyCount entries with vocab criteria selected.\n"; exit( 0 ); --- NEW FILE --- #!/usr/bin/perl # This script parses the Excel-formatted logfiles that get generated by # excel_searches.pl, and produces a report of all searches where *only* # vocab criteria were selected, and no keyword was entered. This must # be run over the original .xls search file (not the .filtered) since # empty keywords are of interest in this case. # # Format for use: # # excel_searches_only_criteria.pl [input_xls] [output_xls] # # Ryan Deardorff, Sep. 2004 $log_in = $ARGV[ 0 ]; $log_out = $ARGV[ 1 ]; open( IN, $log_in ) || die "Couldn't open $log_in"; $firstLine = <IN>; while ( <IN> ) { if ( /^[^\t]+\t[^\t]+\t[^\t]+\t[^\t]+\t\"([^\t]*)\"\t1\-\-10(\t.*)$/ ) { $totalSearches++; if ( ( $1 !~ /\S/ ) && ( $2 =~ /1/ ) ) { $outData .= $_; } else { $emptyCount++; } } else { $emptyCount++; } $linesCount++; } close( IN ); open( OUT, ">" . $log_out ) || die "Couldn't write to $log_out"; print OUT $firstLine . $outData; close( OUT ); print "Processed $linesCount entries, found $totalSearches total searches.\n"; exit( 0 ); |