Click here to get back home

print to terminal

 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
print to terminal alexxx.magni@gmail.com 11-16-2006
---> Re: print to terminal Christian Winte...11-16-2006
  `--> Re: print to terminal alexxx.magni@gm...11-20-2006
Posted by alexxx.magni@gmail.com on November 16, 2006, 5:54 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 Christian Winter on November 16, 2006, 6:02 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 alexxx.magni@gmail.com on November 20, 2006, 4:49 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
Terminal size January 8, 2005, 1:03 am
Terminal emulator February 14, 2006, 2:49 pm
Interacting With A Terminal App March 6, 2006, 4:58 pm
How to determine whether output is a terminal? November 21, 2007, 11:28 pm
I have something funky going on with the controlling terminal August 4, 2008, 10:14 pm
Net::Telnet, Terminal Programs, Prompts March 2, 2005, 7:50 am
How to clear all previous terminal output which is currently visible? May 4, 2008, 8:17 am
running shell command without echo in terminal May 21, 2008, 3:50 pm
Addressing the cursor of a VT100 style terminal emulator using perl December 28, 2005, 10:06 pm
problem starting perl script from cron environment - ps: don't know which terminal to select March 19, 2008, 8:24 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap