Click here to get back home

perl win32 & output of printf

 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
perl win32 & output of printf vp 11-05-2004
Posted by vp on November 5, 2004, 4:15 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
To store the output of printf into a variable... April 3, 2005, 9:56 am
win32::process capture the output June 5, 2006, 4:59 am
Re: how to get the output from: Win32::Process::Create August 31, 2006, 7:06 pm
how to get the output from: Win32::Process::Create August 31, 2006, 2:58 pm
Multiple Line output using Win32::Printer June 8, 2006, 5:47 am
Viewing perldoc output on Win32 - Ideas an Opinions June 8, 2005, 11:28 am
Re: printf doesn't do right justify March 9, 2008, 8:32 am
printf doesn't do right justify March 9, 2008, 8:04 am
printf and variable length? October 25, 2005, 10:03 am
Using printf to modify scalars May 19, 2006, 8:44 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap