Click here to get back home

dump text to excel and CPAN search

 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
dump text to excel and CPAN search ngoc 08-15-2005
Get Chitika Premium
Posted by ngoc on August 15, 2005, 12:29 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

Posted by Matt Garrish on August 15, 2005, 8:01 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 jmcnamara on August 15, 2005, 6:40 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
rt.cpan.org, search.cpan.org: why so unuseable? June 14, 2008, 8:34 pm
CPAN Write Excel January 10, 2007, 10:11 pm
Is there a better way to search CPAN than search.cpan.org? October 11, 2005, 3:03 am
FYI - How to add CPAN as a search plugin for Firefox April 2, 2008, 1:42 pm
http://search.cpan.org/ getting 502 Bad Gateway error September 18, 2005, 1:50 pm
Problem with search.cpan.org grep tool January 29, 2006, 7:02 pm
500 Can't connect to search.cpan.org:80 (Bad protocol 'tcp') at web.plline 24. November 27, 2004, 7:37 pm
Database vs Text for text search August 19, 2004, 9:45 pm
Converting the text output to excel via perl. August 25, 2008, 3:10 am
Using an array to search a text file May 8, 2007, 9:14 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap