Click here to get back home

globbing files with spaces in the path

 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
globbing files with spaces in the path Scott Bass 01-06-2006
Posted by Scott Bass on January 6, 2006, 4:57 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
help with Globbing : use of -r with glob catches only half of the matching files ... June 9, 2006, 5:10 pm
Re: passing filename path with spaces to subs March 23, 2008, 11:22 pm
Re: passing filename path with spaces to subs March 24, 2008, 2:18 am
File-Find skips directories with spaces depending on path separator on Windows January 14, 2006, 8:20 pm
Exec/System call with spaces in exec path problem ... December 2, 2005, 1:41 pm
Help with globbing September 13, 2004, 11:45 am
DOS globbing April 9, 2006, 4:17 pm
globbing mess January 14, 2006, 1:08 pm
Globbing on Win32 February 5, 2007, 6:41 am
embedded perl path $ENV problem September 22, 2004, 4:29 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap