mlaursen has asked for the wisdom of the Perl Monks concerning the following question:

I have data that is zero filled on the front. I am putting it into an excel spread sheet created by a perl script. Is there a way to mark this a text, so excel will not remove the leading zeros? Code:
$handler = ExcelSAX->new("$excel_file_path", 0, $callback); $parser = XML::SAX::ExpatXS->new( Handler => $handler ); $parser->parse_uri($file);

Replies are listed 'Best First'.
Re: Text Column in Excel
by wallisds (Beadle) on Apr 19, 2011 at 16:12 UTC
Re: Text Column in Excel
by mlaursen (Initiate) on Apr 19, 2011 at 21:16 UTC
    You sent me down the right path. I found how to allow leading zeros.

    $worksheet->keep_leading_zeros( ) # Set on

    $worksheet->keep_leading_zeros( 1 ); # Set on

    $worksheet->keep_leading_zeros( 0 ); # Set off

    Thanks!!