--- parse.pl.orig	2010-06-11 07:29:33.474218671 -0500
+++ parse.pl	2010-06-11 07:34:54.214009084 -0500
@@ -204,16 +204,22 @@
         AO => { type => 'bulls', attr => 'weight' },
       );
 
+      my $slot = $row - 4;
+
+      # normalize cell value to stripped value or ''
+      my $value = defined $cell->{Val} ? $cell->{Val} : '';
+      if( $value ne '' ) {
+        # strip leading/trailing whitespace
+        s/^\s+//, s/\s+\z//
+          for $value;
+      }
+
       if( exists $col_map{$col} ) {
-        my ( $slot, $type, $attr )
-           = ( $row - 4, @{ $col_map{$col} }{qw/ type attr /} );
+        my ( $type, $attr ) = ( @{ $col_map{$col} }{qw/ type attr /} );
 
-        if( defined $cell->{Val} && length $cell->{Val} ) {
-          $worksheet->{$type}[$slot]{$attr} = $cell->{Val};
-        }
-        else {
-          $worksheet->{$type}[$slot]{$attr} = 0;
-        }
+        # use existing value or assign to 0 if not present
+        $worksheet->{$type}[$slot]{$attr}
+          = $value ne '' ? $value : 0;
       }
       elsif( $col eq 'AK' ) {
         my %lot_map = (
@@ -222,10 +228,10 @@
         );
 
         for my $prefix ( keys %lot_map ) {
-          my ( $slot, $type ) = ( $row - 4, $lot_map{$prefix} );
-          my $lot_number      = sprintf '%s%03d', $prefix, $cell->{Val};
+          my $type = $lot_map{$prefix};
 
-          $worksheet->{$type}[$slot]{lot_number} = $lot_number;
+          $worksheet->{$type}[$slot]{lot_number}
+            = sprintf '%s%03d', $prefix, $value;
         }
       }
     }
