src/utils/qa/countRows.csh 1.7
1.7 2009/06/08 22:55:36 kuhn
added missinf endquote
Index: src/utils/qa/countRows.csh
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/utils/qa/countRows.csh,v
retrieving revision 1.6
retrieving revision 1.7
diff -b -B -U 1000000 -r1.6 -r1.7
--- src/utils/qa/countRows.csh 11 Apr 2009 00:37:02 -0000 1.6
+++ src/utils/qa/countRows.csh 8 Jun 2009 22:55:36 -0000 1.7
@@ -1,89 +1,89 @@
#!/bin/tcsh
source `which qaConfig.csh`
################################
# 05-19-04
# gets the rowcount for a list of tables.
#
################################
set db=""
set tablelist=""
set argFlag=0
set all=""
set outname=""
if ($#argv < 2) then
echo
echo " gets the rowcount for a list of tables from dev and beta."
echo
- echo " usage: database tablelist [verbose]
+ echo " usage: database tablelist [verbose]"
echo " tablelist can be just name of single table"
echo " verbose reports rowcounts even if dev = beta"
echo
exit
else
set db=$argv[1]
set tablelist=$argv[2] # file of tablenames or single table name
if ($#argv > 2) then
set all=$argv[3]
endif
endif
# echo "database: $db"
echo
if (-e $tablelist) then
echo "running countRows for tables:"
cat $tablelist
echo
endif
# if $argv[2] was a track name, not a list of tables, make a file
if (! -e $tablelist) then
echo $argv[2] > xxtablelistxx
set tablelist="xxtablelistxx"
set outname=$argv[2]
else
# strip dbname from tablelist name, if present
set outname=`echo $tablelist | sed -e "s/$db\.//"`
endif
# echo "outname = $outname"
rm -f $db.$outname.rowcounts
rm -f $db.$outname.badcounts
foreach table (`cat $tablelist`)
set dev=`hgsql -N -e "SELECT COUNT(*) FROM $table" $db`
set beta=`hgsql -h $sqlbeta -N -e "SELECT COUNT(*) FROM $table" $db`
if ($dev != $beta) then
echo $table >> $db.$outname.badcounts
echo $table >> $db.$outname.rowcounts
echo "=============" >> $db.$outname.rowcounts
echo "."$dev >> $db.$outname.rowcounts
echo "."$beta >> $db.$outname.rowcounts
echo >> $db.$outname.rowcounts
else
if ($all == "all") then
# save info on equal counts, too
echo $table >> $db.$outname.rowcounts
echo "=============" >> $db.$outname.rowcounts
echo "."$dev >> $db.$outname.rowcounts
echo "."$beta >> $db.$outname.rowcounts
echo >> $db.$outname.rowcounts
endif
endif
end
# clean out file
rm -f xxtablelistxx
# show results
if (-e $db.$outname.rowcounts) then
# echo "dev first"
echo
cat $db.$outname.rowcounts
else
echo "all tables have same count of rows"
echo
endif