Redmond morons strike again.

F

Fred Bartoli

Guest
I run under W2K and have a whole directory of files named "abc%20deXX.ext"
that I need to rename as "abc deXX.ext" (i.e. chane the %20 to a space)
with XX being 01 to 99.

Easy (I thought) : rename "abc%20de*.ext" "abc de*.ext"

Sure not. The result is "abc dedeXX.ext"

In the same vein rename "abc%20de??.ext" "abc de??.ext"

Creates one "abc dede.ext" for the first file and complains for the others
the file name already exists.


Anyone having some idea?


--
Thanks,
Fred.
 
On Sat, 19 Feb 2005 16:22:37 +0100, Fred Bartoli <fred._canxxxel_this_bartoli@RemoveThatAlso_free.fr_AndThisToo> wrote:
I run under W2K and have a whole directory of files named "abc%20deXX.ext"
that I need to rename as "abc deXX.ext" (i.e. chane the %20 to a space)
with XX being 01 to 99.

Easy (I thought) : rename "abc%20de*.ext" "abc de*.ext"

Sure not. The result is "abc dedeXX.ext"

In the same vein rename "abc%20de??.ext" "abc de??.ext"

Creates one "abc dede.ext" for the first file and complains for the others
the file name already exists.

Anyone having some idea?
Don't use astericks in the pattern strings.

rename "%20" " " *.ext
 
On Sat, 19 Feb 2005 16:22:37 +0100, "Fred Bartoli"
<fred._canxxxel_this_bartoli@RemoveThatAlso_free.fr_AndThisToo>
wrote:

I run under W2K and have a whole directory of files named "abc%20deXX.ext"
that I need to rename as "abc deXX.ext" (i.e. chane the %20 to a space)
with XX being 01 to 99.

Easy (I thought) : rename "abc%20de*.ext" "abc de*.ext"

Sure not. The result is "abc dedeXX.ext"

In the same vein rename "abc%20de??.ext" "abc de??.ext"

Creates one "abc dede.ext" for the first file and complains for the others
the file name already exists.


Anyone having some idea?
What does Redmond have to do with your programming problem? You
might want to check the alt.msdos.batch.nt news group where your
problem can probably be solved quickly.
 
Do in 2 steps that it likes

Fred Bartoli wrote:

I run under W2K and have a whole directory of files named "abc%20deXX.ext"
that I need to rename as "abc deXX.ext" (i.e. chane the %20 to a space)
with XX being 01 to 99.

Easy (I thought) : rename "abc%20de*.ext" "abc de*.ext"

Sure not. The result is "abc dedeXX.ext"

In the same vein rename "abc%20de??.ext" "abc de??.ext"

Creates one "abc dede.ext" for the first file and complains for the others
the file name already exists.


Anyone having some idea?
 
In article <toWdnZjAHepT-4rfRVn-3A@buckeye-express.com>,
Mark Jones <abuse@127.0.0.1> wrote:
[...]
In linux this is probably possible... can't say I've seen a command in DOS that
will accomplish any equivalent. Perhaps it could be done with advanced batch
file syntax, but has anyone ever officially "leanred" batch language? From what
I've seen the wildcard symbols ? and * match ANY case, not sequential case. The
easiest solution might be to make a small VB, C++ (check out MinGW32), or
assembler program (www.masm32.com, http://winasm.net) to accomplish the task.
Good luck.

I know DOS batch stuff fairly well. There is little you can do in a batch
file that you cant do by typing the commands. Perhaps the easiest thing
to do is to:

dir /B *.ext >temp.bat

then edit temp.bat to make the commands needed.


--
--
kensmith@rahul.net forging knowledge
 
Fred Bartoli wrote:
I run under W2K and have a whole directory of files named "abc%20deXX.ext"
that I need to rename as "abc deXX.ext" (i.e. chane the %20 to a space)
with XX being 01 to 99.

Easy (I thought) : rename "abc%20de*.ext" "abc de*.ext"

Sure not. The result is "abc dedeXX.ext"

In the same vein rename "abc%20de??.ext" "abc de??.ext"

Creates one "abc dede.ext" for the first file and complains for the others
the file name already exists.

Anyone having some idea?

--
Thanks,
Fred.
Try something like this:
REN ABC?DE*.EXT ABC DE*.EXT
I have not tried this, but i am ASSuMEing that the %20 is interpreted
as one character.
If not, ASSuME it gets interpreted as two characters and use two ??;
if that fails then go for what you see as 3 characters.
 
Fred Bartoli wrote:

Now there still remains the question: why didn't they implemented the
obvious?
Nobody but you want the obvious implemented. Bill Gates said so
himself: See [ www.cantrip.org/nobugs.html ].

Also, because they bought a bastardized clone of CP/M when they
started and have been building a house of cards on that base
for years.

They have so much code in Windows that nobody undersands (and
it appears that they managed to lose at least part of the source
code somewhere along the way) that any change may bring the whole
house of cards tumbling down, with a very real possibility that
the instability the change introduces will be invisible until a
user does something that the testers never tried doing.
 

Welcome to EDABoard.com

Sponsor

Back
Top