At 09:45 PM 12/12/2003, R. Joseph Newton wrote:
>Paul Kraus wrote:
>
>> Is there a way to write a CSV file so that excel wont drop the leading
>> zero's from fields? I could use spreadsheet::writeexcel or OLE but
>> that's like using a sledgehammer for something that needs to be hand
>> tightened.
>>
>> Thanks.
>> Paul
>
>Leading zeroes are meaningful only in strings.  If you want leading zeroes
>in your data, signify that the value is a string by quoting it.  It will
>totally make a hash of any numerical functions on the field, but if
>leading zeroes are that important...

This doesn't work, Excel still strips the delimiters and displays the number as numeric

>You could also think about the proper place to concern yourself with data,
>and where to concern yourself with it's representation.  A database table,
>such as a CSV file, has one set of needs.  A report has a comletely
>different set.  Don't wate energy trying to line things up verticall in
>stored data.  Just translate to your desired presentation format on
>extraction.
>
>So why do you need leading zeroes?

My case is patient medical record numbers, which are always 9 digits and may have a 
leading zero.  I have had this problem a long time, I just format the cells after the 
conversion process.

-Mark 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to