1. RE: Digest for EUforum at topica.com, issue 6085

> Subject: RENAME problem: directories with spaces?
> 
> 
> posted by: Dan Moyer <danielmoyer at prodigy.net>
> 
> 
> Juergen's suggestion for using "rename" with "system" command,  
> }}}
<eucode>
> sequence myvar
> myvar = "\"the old.txt\" \"the new.txt\""    -- or whatever 
> is required
> system("rename " & myvar, 2)
> </eucode>
{{{

> seems like it should have worked, but didn't; I get an error about
>  "bad command format", but when I make it print out, it looks 
> fine, except:  
> 
> the path to the file(s) includes more than one directory with 
> SPACES in them,
> which I think is the problem, and I vaguely remember that 
> there's a "trick"
> to making directories with spaces work, but I don't rember what it IS.
> 
> Is there such a trick?  (& what is it if there is)
> (in the code example above, I put the path to the file in 
> front of myvar)
> 
> Dan
> 

To pass directory names with spaces or other non alpha characters in it, you
only have to surround them with double quotes, as in

rename "C:\Program Files\test" "C:\Program Files\old test"

which needs the following Eu code to be issued:

system(
"rename \"C:\\Program Files\\test\" \"C:\\Program Files\\old test\""
,2)


Another, simpler trick is to use any of the freely available file mass
renamers. They will enable you to use wildcards and regular expresssions,
definitely lightening the burden.

CChris

new topic     » topic index » view message » categorize

2. RE: Digest for EUforum at topica.com, issue 6085

The subject of this thread certainly is NOT
"Digest for EUforum at topica.com, issue 6085"

Cuvier Christian wrote:

>> posted by: Dan Moyer <danielmoyer at prodigy.net>
>>
>>
>> Juergen's suggestion for using "rename" with "system" command,
>> }}}
<eucode>
>> sequence myvar
>> myvar = "\"the old.txt\" \"the new.txt\""    -- or whatever
>> is required
>> system("rename " & myvar, 2)
>> </eucode>
{{{

>> seems like it should have worked, but didn't; I get an error about
>>  "bad command format", but when I make it print out, it looks
>> fine, except:
>>
>> the path to the file(s) includes more than one directory with
>> SPACES in them,
>> which I think is the problem, and I vaguely remember that
>> there's a "trick"
>> to making directories with spaces work, but I don't rember what it IS.
>>
>> Is there such a trick?  (& what is it if there is)
>> (in the code example above, I put the path to the file in
>> front of myvar)
>>
>> Dan
>>
> 
> To pass directory names with spaces or other non alpha characters in it, you
> only have to surround them with double quotes, as in

This is correct on principle, but "only" is false (see below).

> rename "C:\Program Files\test" "C:\Program Files\old test"
> 
> which needs the following Eu code to be issued:
> 
> }}}
<eucode>
> system(
> "rename \"C:\\Program Files\\test\" \"C:\\Program Files\\old test\""
> ,2)
> </eucode>
{{{


Code like this does not work on my system, see
<http://www.listfilter.com/EUforum/m9587.html>.

Regards,
   Juergen

-- 
Who is general fault, and why does he read my hard disk?

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu