Click here to get back home

spaces in paths

 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
spaces in paths Eric.Medlin 08-29-2005
`--> Re: spaces in paths Gunnar Hjalmars...08-29-2005
Posted by Eric.Medlin on August 29, 2005, 2:09 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

Posted by Gunnar Hjalmarsson on August 29, 2005, 11:31 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
Paths help March 12, 2006, 7:05 am
Using UNC paths and ssh with perl August 16, 2005, 3:52 am
Checking for safe paths March 9, 2005, 7:59 pm
Expanding tree paths July 19, 2005, 10:48 am
Windows paths in glob March 30, 2008, 3:09 pm
Getting 'system' to Process Win32 Paths Correctly July 14, 2005, 6:38 am
File::Find dies on directory paths which are too long March 13, 2007, 2:53 pm
Migrating thousands of user home, profile, apps and groups directory paths August 20, 2005, 9:51 am
Replacing spaces September 19, 2004, 3:39 am
What are these extra spaces in my registry? October 27, 2004, 4:24 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap