Click here to get back home

export to excel

 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
export to excel ocap 11-28-2004
Posted by ocap on November 28, 2004, 2:02 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 Leon on November 28, 2004, 2:57 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
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
Env export in perl June 6, 2005, 12:07 am
Export module November 22, 2006, 1:07 pm
Export *ALL* functions from a module June 21, 2005, 5:27 am
export a variable from a module March 10, 2006, 6:27 am
How to export the matched text to log file? May 25, 2006, 8:30 am
trying to export some utility methods, and struggling September 7, 2007, 4:00 am
Trying to use my own module directory, but Perl doesn't see @EXPORT August 3, 2008, 8:37 pm
How to use a module's @EXPORT array to document its exported objects? July 19, 2006, 12:52 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap