Click here to get back home

input - output

 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
input - output nicolas-laurent 03-26-2005
|--> Re: input - output Gunnar Hjalmars...03-26-2005
---> Re: input - output Fabian Pilkowsk...03-26-2005
Get Chitika Premium
Posted by John W. Krahn on March 26, 2005, 8:47 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
Is it possible to open a file for both input & output April 27, 2006, 8:14 am
Is it possible to open aa file for both input & output April 27, 2006, 8:41 am
Device::ParallelPort input and output May 12, 2008, 9:10 am
localtime - user input - output in same format October 7, 2004, 1:27 am
UTF16 input file to ISO-8859-1 output April 16, 2007, 9:56 am
Capturing output with simultaneous File handle input July 1, 2005, 7:07 pm
Perl output Javascript to validate user input April 4, 2006, 2:50 pm
Silencing TODO output from Test::Harness output October 17, 2006, 1:07 am
March 4, 2007, 11:19 am
while() with linefeeds July 15, 2004, 10:21 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap