Click here to get back home

Problem with excel workbook

 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
Problem with excel workbook marzec.wojciech 07-26-2007
Get Chitika Premium
Posted by marzec.wojciech on July 26, 2007, 8:11 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 Lambik on July 26, 2007, 10:21 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

Similar ThreadsPosted
problem of copying individual worksheets in separate workbook June 26, 2007, 7:26 am
Win32::OLE Excel problem November 19, 2004, 11:56 am
Write Excel problem June 7, 2005, 10:14 pm
Problem with Name of Excel Chart September 22, 2005, 9:21 am
Problem using Spreadsheet::Excel October 31, 2006, 12:49 pm
Serious Problem while appending an Excel file July 24, 2007, 10:56 am
adding an excel worksheet to a generetad excel file via perl April 17, 2007, 8:38 am
OLE & Excel - Opening causes Excel.exe to hang around April 21, 2005, 1:20 pm
Modify Excel August 5, 2004, 10:25 am
export to excel November 28, 2004, 2:02 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap