X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=erange.git;a=blobdiff_plain;f=colsum.py;h=643aaeaa82b8bc0c444e33ae909d4f5859e2b1d7;hp=703bd5ce47ae4b136321c42a6debe8f6b7908d01;hb=HEAD;hpb=5e4ae21098dba3d1edcf11e7279da0d84c3422e4 diff --git a/colsum.py b/colsum.py index 703bd5c..643aaea 100755 --- a/colsum.py +++ b/colsum.py @@ -4,7 +4,7 @@ def main(argv=None): if not argv: argv = sys.argv - print "version 1.2" + print "colsum: version 1.3" if len(argv) < 3: print "usage: python %s field filename" % argv[0] print "\n\tfields are counted starting at zero.\n" @@ -28,7 +28,7 @@ def colsum(fieldID, filename): count += float(fields[fieldID]) else: count += int(fields[fieldID]) - except ValueError: + except (ValueError, IndexError): pass infile.close()