Click here to get back home

search perldocs against each word in a string

 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
search perldocs against each word in a string ioneabu 02-15-2005
Posted by ioneabu on February 15, 2005, 9:28 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
search perldocs against each word in a string February 15, 2005, 9:29 pm
Help: String search in Windows 2000 doesn't find text in WindowsXP: MS Word document November 27, 2005, 9:13 am
best way to search perldocs September 26, 2004, 7:52 pm
Search a Text File for a String, Return String to Function July 29, 2006, 12:19 pm
Best way to remove last word from a string August 3, 2004, 11:33 pm
Regex matching a string that DOESN'T contain a given word August 31, 2004, 1:07 pm
reg expr, extract word from string October 7, 2005, 4:12 am
How to search a string in a given line February 7, 2006, 4:12 am
Perl String Search April 19, 2006, 11:19 am
Simple string search November 1, 2007, 10:57 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap