Click here to get back home

Copying a folder

 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
Copying a folder Jim 11-20-2004
| `--> Re: Copying a folder Tassilo v. Pars...11-21-2004
Get Chitika Premium
Posted by Jim on November 22, 2004, 7:18 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
copying files October 24, 2004, 4:42 am
copying arrays February 15, 2008, 2:11 pm
copying hashes without references December 30, 2004, 8:44 pm
Copying part of a hash to another July 3, 2005, 10:22 am
Use of Substitution and copying into a new file October 17, 2006, 8:13 pm
File::Find and tree copying June 1, 2005, 4:21 pm
Copying complex data structure January 25, 2006, 3:58 pm
Copying text to clipboard in UNIX May 10, 2006, 1:36 am
File Permissions using NIS and NFS and copying via perl November 1, 2006, 8:56 am
problem of copying individual worksheets in separate workbook June 26, 2007, 7:26 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap