Click here to get back home

adding an excel worksheet to a generetad excel file via perl

 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
adding an excel worksheet to a generetad excel file via perl FlorianKraft 04-17-2007
Posted by FlorianKraft on April 17, 2007, 8:38 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 Mirco Wahab on April 17, 2007, 8:53 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
How to delete excel worksheet in perl? May 24, 2006, 10:53 am
Excel worksheet position November 16, 2005, 7:08 am
Win32::OLE - saving content of just one worksheet in Excel January 5, 2007, 5:33 pm
OLE & Excel - Opening causes Excel.exe to hang around April 21, 2005, 1:20 pm
Using Perl to Parse Excel File February 16, 2005, 12:33 pm
puting an excel file into a perl data structure June 28, 2006, 12:16 pm
Perl script does nt parses d entire excel file please help August 4, 2006, 4:42 am
Convert file to excel September 22, 2006, 1:49 pm
Extract data from an Excel file January 13, 2006, 1:36 am
Serious Problem while appending an Excel file July 24, 2007, 10:56 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap