Click here to get back home

Re: Platypus - Current Working Directory - write files

 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
Re: Platypus - Current Working Directory - write files Markus S 11-06-2007
Posted by Markus S on November 6, 2007, 7:25 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 Peter J. Holzer on November 10, 2007, 5:24 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
Platypus - Current Working Directory - write files November 5, 2007, 7:06 pm
Platypus - Current Working Directory - write file November 6, 2007, 1:19 pm
Re: Platypus - Current Working Directory - write file November 6, 2007, 1:29 pm
Re: Platypus - Current Working Directory - write file November 6, 2007, 2:04 pm
Re: Platypus - Current Working Directory - write file November 6, 2007, 2:30 pm
Re: Platypus - Current Working Directory - write file November 6, 2007, 7:22 pm
Getting all directories/files from current directory and using -d flag for the directories October 8, 2004, 2:05 pm
current directory name in perl August 14, 2006, 11:53 am
Perl and current directory December 9, 2006, 4:41 am
current directory, practical problem June 17, 2008, 9:42 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap