Click here to get back home

How to get an Excel cell value that's based on a function using Win32::OLE

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
How to get an Excel cell value that's based on a function using Win32::OLE pdfella 12-13-2006
Posted by pdfella on December 13, 2006, 1:09 am
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Posted by Brian Helterline on December 14, 2006, 3:38 pm
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Similar ThreadsPosted
Checking for empty cell in Excel Spreadsheet September 24, 2006, 3:39 pm
Spreadsheet::[Parse|Write]Excel - accessing the contents of a cell July 6, 2006, 4:51 pm
Win32::OLE Excel problem November 19, 2004, 11:56 am
win32::OLE::Excel and lists June 17, 2005, 6:55 am
WIN32::OLE excel date November 2, 2006, 4:54 pm
Win32 OLE Excel existing May 27, 2008, 11:57 am
Integer overflow in Excel using Win32::OLE May 16, 2006, 6:35 am
Locate last populated row/column in Excel with Win32::OLE September 16, 2004, 12:34 pm
Win32::OLE check if excel is English or Swedish February 14, 2005, 5:29 pm
Disabling auto-calculation in Excel via Win32::OLE January 26, 2006, 9:03 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap