Click here to get back home

Collecting details from router, striping info, map and regex. Example.

 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
Collecting details from router, striping info, map and regex. Example. johngnub 04-10-2007
Get Chitika Premium
Posted by johngnub on April 10, 2007, 3: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 J. Gleixner on April 10, 2007, 4:45 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
Correcting details for a CPAN module. December 12, 2005, 10:59 pm
Accessing "Details" of a Folder. Now to write a "comment" for a file. July 19, 2004, 9:33 pm
CGI for collecting phone numbers June 9, 2006, 10:16 am
domains, top level, collecting a list of January 29, 2008, 3:37 pm
Collecting multiple element names using grouptag December 19, 2005, 8:49 am
LWP and speedstream router July 1, 2005, 2:29 pm
ssh to cisco router with expect CPAN March 18, 2005, 8:53 pm
ActivePerl error message? Router script. Please help.Newbie May 17, 2006, 9:58 am
Re: Script to disconnect Linksys WRT54G wireless router on Windows November 20, 2007, 2:01 pm
Need info March 9, 2006, 8: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