Click here to get back home

Whats the way of wildcard HoH extraction?

 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
Whats the way of wildcard HoH extraction? ipellew 01-17-2005
Posted by ipellew on January 17, 2005, 3:36 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 Gunnar Hjalmarsson on January 18, 2005, 12:56 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

Similar ThreadsPosted
Just a basic wildcard January 31, 2006, 6:20 pm
wildcard the port in bind January 18, 2005, 3:27 am
regexp to sql wildcard conversion June 27, 2005, 2:16 am
Perl wildcard un-expansion November 19, 2007, 4:36 am
Module to match file names against a wildcard spec? June 16, 2005, 12:31 am
Whats the reason for this?? December 1, 2005, 4:33 pm
Whats the most complicate RegEX that can be done? October 9, 2005, 4:10 pm
Whats the variable holding the dir seperator? January 19, 2005, 4:58 pm
whats perls emailing list December 20, 2005, 3:22 pm
XPATH - How to get rid of warnings or whats wrong! December 19, 2006, 8:12 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap