viffer has asked for the wisdom of the Perl Monks concerning the following question:
I have a, hopefully, simple query.
I am writing a comma separated output file called xyz.csv
One of the columns has a large digit number in which, when opening in Excel, displays as (for example) 1.20201E+13 rather than 12011621300726.
I am not using "Spreadsheet::WriteExcel" but a simple
Is there a way within that simple print statement that you can replicate the type of code you'd use in 'write excel' that would enable the large digit field ($number$i) to be viewed as if the cell had been formatted as 'number'?open( OUT, '>', "$output_file" ) or croak "Unable to open $output_file +, $!"; print OUT "$number[2], $number[$i], $number[$i+1]\n";
Thanksmy $fmt = $workbook->add_format( num_format => '0' ); $worksheet->write_string( 'A2', $number[$i], $fmt );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Formatting a csv column as 'number'
by Tux (Canon) on Mar 13, 2012 at 07:03 UTC | |
by viffer (Beadle) on Apr 02, 2014 at 02:01 UTC | |
|
Re: Formatting a csv column as 'number'
by bitingduck (Deacon) on Mar 13, 2012 at 05:37 UTC | |
|
Re: Formatting a csv column as 'number'
by hawtin (Prior) on Mar 13, 2012 at 20:37 UTC |