Reposting for the list since it was caught up due to a change at my company's end. Just another potential solution that some might like.
[EMAIL PROTECTED] wrote on 02/08/2006 03:05:15 PM: > 3. Importing into Excel (Erich Singer) > 6. Re: Importing into Excel (Todd Beverly) > > > > ------------------------------ > > Message: 6 > Date: Wed, 08 Feb 2006 13:25:35 -0500 > From: Todd Beverly <[EMAIL PROTECTED]> > Subject: Re: Importing into Excel > To: Erich Singer <[EMAIL PROTECTED]> > Cc: [email protected] > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Erich Singer wrote: > > > > > > I am using PERL (Spreadsheet::WriteExcel)on Windows to import data into > > Excel 2003. Everything is working fine, except when I have to import > > a string that contains only numbers, such as 00123456789. It gets > > imported as 123456789, e.g. missing the leading 00. A solution could be > > to modify the string to be 00123456789_. The disadvantage is that after > > the import, I have to remove the "_" from 00123456789 > Try using a space before the number, i.e. " 00123456789". I haven't > used Spreadsheet::WriteExcel for A while, but this technique works for > the Win32::OLE method. > Another potential solution is to add a ' before the number. ie: if the code looks like: foreach $values (@values){ Spreadsheet::WriteExcel($value); } then make it: foreach $values (@values){ if(isdigit($value)){ $value="'$value"; } Spreadsheet::WriteExcel($value); } note that I have never used the package. I just happen to know that Excel is one of many spreadsheet programs that uses a leading tick to denote the data should be treated as a string even though it will be a digit. it prints without the tick but shows up when you put the selection on that box. HTH -Josh ----------------------------------------- PLEASE NOTE: SeaChange International headquarters in Maynard, MA is moving! Effective March 1, 2006, our new headquarters address will be: SeaChange International 50 Nagog Park Acton, MA 01720 USA All telephone numbers remain the same: Main Corporate Telephone: 978-897-0100 Customer Service Telephone: 978-897-7300 _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
