Click here to get back home

looking for simple code to build a search engine

 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
looking for simple code to build a search engine Marcel 11-30-2004
Posted by Marcel on November 30, 2004, 10:47 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 Gregory Toomey on December 1, 2004, 2:23 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
Perl search engine June 27, 2008, 10:51 pm
Vector Space Search Engine October 11, 2005, 1:14 am
Make a search engine for your website with PHP October 17, 2005, 3:02 am
Google Custom Search Engine December 27, 2006, 11:25 am
...How to parse search engine results fast? February 3, 2005, 9:17 am
Funny! More offers to select a search engine! January 17, 2006, 10:36 pm
Funny! More offers to select a search engine! (PP) January 19, 2006, 11:32 pm
List of free people search engine December 7, 2007, 11:42 pm
Guaranteed Search Engine Placement - www.GuaranteedTop20.info November 18, 2005, 2:14 pm
Search Engine Marketing (SEM), SEM Firm India, Internet Marketing Services India Hyderabad December 20, 2007, 3:33 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap