Click here to get back home

Re: A Sort Optimization Technique: decorate-sort-dedecorate

 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
Re: A Sort Optimization Technique: decorate-sort-dedecorate Jamie 08-30-2006
Posted by Jamie on August 30, 2006, 4:32 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
compiler optimization October 30, 2004, 3:41 am
Regexp optimization April 17, 2005, 11:53 pm
looking for some size optimization April 15, 2007, 8:22 am
String comparison optimization November 29, 2006, 1:40 pm
Trebuchet calculation/optimization in Perl? October 31, 2005, 3:01 pm
combinations script - out of memory - optimization? March 15, 2006, 12:46 pm
can Perl Sort do this, unix sort breaks on it (muliple spaces as demiliter) February 2, 2005, 6:08 pm
[Q]: How to sort first abc, then 123? March 12, 2005, 7:16 pm
sort? May 24, 2007, 1:02 pm
sort March 7, 2008, 10:03 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap