Click here to get back home

updating tools

 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
updating tools Chris 07-10-2005
Posted by Chris on July 10, 2005, 11:20 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 Jim Britain on July 10, 2005, 5:16 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
Problems after updating Net::SSH:Perl March 2, 2006, 10:56 am
Error when Updating Oracle December 4, 2007, 12:06 pm
Inserting & Updating from txtx to a database! May 10, 2005, 12:51 am
need help in updating a website using perl script. November 21, 2005, 4:10 am
Updating @BO_FO_Emails from a web page widget January 20, 2006, 10:35 am
updating date field in MS Access February 27, 2007, 1:30 am
Diff Tools October 17, 2005, 11:11 pm
Visualising / overview tools March 28, 2008, 11:29 am
gtk2 treeview and threads : custom sort while updating rows January 2, 2007, 12:04 pm
Static Code Analysis Tools? December 15, 2004, 7:48 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap