RE: Digest for EUforum at topica.com, issue 6085
- Posted by Cuvier Christian <christian.cuvier at insee.fr> Sep 04, 2006
- 499 views
> 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