It is possible to rename a group of files within the same director

  • Thread starter Thread starter Quco
  • Start date Start date
Q

Quco

I guess this case is not so simple... problem is, I just need to "erase the
first 3 characters of each file".

For example, I have this folder with 1,860 files. All of these files are
named: "ir_#####", where the # sign represents a number. So, each file
contains a 5-digit number preceded by the "ir_". There are no duplicates in
the "#####" section.

I need to remove the "ir_" portion on all 1,860 files.

ir_12345 changes to 12345
ir_24680 changes to 24680
ir_30817 changes to 30817
etc...

Is this possible? How?
 
"Quco" <Quco@discussions.microsoft.com> wrote in message
news:0C3C77EF-8DD9-4B81-A1A1-CF0274F63804@microsoft.com...
>I guess this case is not so simple... problem is, I just need to "erase the
> first 3 characters of each file".
>
> For example, I have this folder with 1,860 files. All of these files are
> named: "ir_#####", where the # sign represents a number. So, each file
> contains a 5-digit number preceded by the "ir_". There are no duplicates
> in
> the "#####" section.
>
> I need to remove the "ir_" portion on all 1,860 files.
>
> ir_12345 changes to 12345
> ir_24680 changes to 24680
> ir_30817 changes to 30817
> etc...
>
> Is this possible? How?
>


You could do it by running this batch file from within the
folder where your 1,860 files reside:

@echo off
dir /b ir_*.* > c:\temp.txt
for /F %%a in (c:\temp.txt) do call :Sub %%a
del c:\temp.txt
goto :eof

:Sub
set old=%1
set new=%old:~3%
echo ren %old% %new%

Remove the word "echo" in the last line to activate the batch file.
 
Re: It is possible to rename a group of files within the same dire

Thanks, but how do I run the batch file? do I copy and paste the code in a
Notepad file and save it with an .exe extension in the same folder?

"Pegasus (MVP)" wrote:

>
> "Quco" <Quco@discussions.microsoft.com> wrote in message
> news:0C3C77EF-8DD9-4B81-A1A1-CF0274F63804@microsoft.com...
> >I guess this case is not so simple... problem is, I just need to "erase the
> > first 3 characters of each file".
> >
> > For example, I have this folder with 1,860 files. All of these files are
> > named: "ir_#####", where the # sign represents a number. So, each file
> > contains a 5-digit number preceded by the "ir_". There are no duplicates
> > in
> > the "#####" section.
> >
> > I need to remove the "ir_" portion on all 1,860 files.
> >
> > ir_12345 changes to 12345
> > ir_24680 changes to 24680
> > ir_30817 changes to 30817
> > etc...
> >
> > Is this possible? How?
> >

>
> You could do it by running this batch file from within the
> folder where your 1,860 files reside:
>
> @echo off
> dir /b ir_*.* > c:\temp.txt
> for /F %%a in (c:\temp.txt) do call :Sub %%a
> del c:\temp.txt
> goto :eof
>
> :Sub
> set old=%1
> set new=%old:~3%
> echo ren %old% %new%
>
> Remove the word "echo" in the last line to activate the batch file.
>
>
>
 
Re: It is possible to rename a group of files within the same dire

You paste the code into a Notepad file and save it as
"Quco.bat". Make sure to select "all files" below the
name file when saving it.


"Quco" <Quco@discussions.microsoft.com> wrote in message
news:48728336-B1DC-4C43-BDDC-1B003EC88FB0@microsoft.com...
> Thanks, but how do I run the batch file? do I copy and paste the code in a
> Notepad file and save it with an .exe extension in the same folder?
>
> "Pegasus (MVP)" wrote:
>
>>
>> "Quco" <Quco@discussions.microsoft.com> wrote in message
>> news:0C3C77EF-8DD9-4B81-A1A1-CF0274F63804@microsoft.com...
>> >I guess this case is not so simple... problem is, I just need to "erase
>> >the
>> > first 3 characters of each file".
>> >
>> > For example, I have this folder with 1,860 files. All of these files
>> > are
>> > named: "ir_#####", where the # sign represents a number. So, each file
>> > contains a 5-digit number preceded by the "ir_". There are no
>> > duplicates
>> > in
>> > the "#####" section.
>> >
>> > I need to remove the "ir_" portion on all 1,860 files.
>> >
>> > ir_12345 changes to 12345
>> > ir_24680 changes to 24680
>> > ir_30817 changes to 30817
>> > etc...
>> >
>> > Is this possible? How?
>> >

>>
>> You could do it by running this batch file from within the
>> folder where your 1,860 files reside:
>>
>> @echo off
>> dir /b ir_*.* > c:\temp.txt
>> for /F %%a in (c:\temp.txt) do call :Sub %%a
>> del c:\temp.txt
>> goto :eof
>>
>> :Sub
>> set old=%1
>> set new=%old:~3%
>> echo ren %old% %new%
>>
>> Remove the word "echo" in the last line to activate the batch file.
>>
>>
>>
 
On Thu, 19 Jul 2007 05:28:02 -0700, Quco
<Quco@discussions.microsoft.com> wrote:

>I need to remove the "ir_" portion on all 1,860 files.
>
>ir_12345 changes to 12345
>ir_24680 changes to 24680
>ir_30817 changes to 30817
>etc...


>Is this possible? How?


Not possible, you'd need a real operating system. You'll need to find
an add-on utility.
 
"+Bob+" <uctraing@ultranet.com> wrote in message
news:1msu93dvcmiuc7glrnsm1iedj804tse5jv@4ax.com...
> On Thu, 19 Jul 2007 05:28:02 -0700, Quco
> <Quco@discussions.microsoft.com> wrote:
>
>>I need to remove the "ir_" portion on all 1,860 files.
>>
>>ir_12345 changes to 12345
>>ir_24680 changes to 24680
>>ir_30817 changes to 30817
>>etc...

>
>>Is this possible? How?

>
> Not possible, you'd need a real operating system. You'll need to find
> an add-on utility.
>


Not possible with a single command but easily done with
a batch file. If you don't like Windows, why do you bother
posting here?
 
On Thu, 19 Jul 2007 05:28:02 -0700, Quco
<Quco@discussions.microsoft.com> wrote:

>I need to remove the "ir_" portion on all 1,860 files.
>
>ir_12345 changes to 12345
>ir_24680 changes to 24680
>ir_30817 changes to 30817


Irfanview is a free image program. It also has batch conversion and
BATCH RENAME capabilities. I use it to do exactly what you want to do.

--
Zilbandy
 
Lupas Rename is a great freeware application for this operation.

I like it because of the "Undo" feature.

http://rename.lupasfreeware.org/


Gord

On Thu, 19 Jul 2007 16:59:48 -0700, Zilbandy <zil@zilbandyREMOVETHIS.com> wrote:

>On Thu, 19 Jul 2007 05:28:02 -0700, Quco
><Quco@discussions.microsoft.com> wrote:
>
>>I need to remove the "ir_" portion on all 1,860 files.
>>
>>ir_12345 changes to 12345
>>ir_24680 changes to 24680
>>ir_30817 changes to 30817

>
>Irfanview is a free image program. It also has batch conversion and
>BATCH RENAME capabilities. I use it to do exactly what you want to do.
 
Bulk Rename Utility is my favorite of the many rename utilities:

http://www.bulkrenameutility.co.uk/Main_Intro.php


Gord Dibben <gorddibbATshawDOTca> wrote in
news:v700a35s14bg2d9ulco70912mmi0n7ul4q@4ax.com:

> Lupas Rename is a great freeware application for this operation.
>
> I like it because of the "Undo" feature.
>
> http://rename.lupasfreeware.org/
>
>
> Gord
>
> On Thu, 19 Jul 2007 16:59:48 -0700, Zilbandy
> <zil@zilbandyREMOVETHIS.com> wrote:
>
>>On Thu, 19 Jul 2007 05:28:02 -0700, Quco
>><Quco@discussions.microsoft.com> wrote:
>>
>>>I need to remove the "ir_" portion on all 1,860 files.
>>>
>>>ir_12345 changes to 12345
>>>ir_24680 changes to 24680
>>>ir_30817 changes to 30817

>>
>>Irfanview is a free image program. It also has batch conversion and
>>BATCH RENAME capabilities. I use it to do exactly what you want to do.

>
>
 
On Thu, 19 Jul 2007 16:41:36 +0200, "Pegasus \(MVP\)" <I.can@fly.com>
wrote:

>Not possible with a single command but easily done with
>a batch file. If you don't like Windows, why do you bother
>posting here?


First, I compliment you on your .bat file. I'll keep it around for
reference. I hadn't seen that done in DOS before.

Second, Windows is a bug ridden (P)OS with limited capabilities and
major architectural flaws. Instead of fixing the architecture or
flaws, they continue to build new, major revision versions. MS has
shown that their only dedication if to their wallet, not to producing
a quality product.

So, why do I post here? Because I use Windows. Why do I use Windows?
Because due to poor decisions by some large manufacturers years ago,
and now due to simple multi-billion $ clout, MS is the only practical
alternative. But, the fact that I use it doesn't change the fact that
it sucks.
 
On Fri, 20 Jul 2007 08:17:44 -0400, +Bob+ <uctraing@ultranet.com>
wrote:

>Second, Windows is a bug ridden (P)OS with limited capabilities and
>major architectural flaws. Instead of fixing the architecture or
>flaws, they continue to build new, major revision versions. MS has
>shown that their only dedication if to their wallet, not to producing
>a quality product.


Microsoft is in a catch 22 situation. To make money, they need to sell
new products. Without money, they can't do anything. Would you be
willing to pay for Service Patches to XP? Right now, all the XP
continuing support is not being paid for by sales of XP. Without new
products, there would be no continued support for XP and the Windows
world be a much gloomier place than it is.

--
Zilbandy
 
Poor guys at Microsoft !!!!!!!!!!!!!

Maybe only a little reduction of their huge profits (isn't Bill one of
the five most richest people in the World?) would increase the quality
of their Service Patches to XP (and the related customer care) a lot.

Zilbandy <zil@zilbandyREMOVETHIS.com> wrote:

>On Fri, 20 Jul 2007 08:17:44 -0400, +Bob+ <uctraing@ultranet.com>
>wrote:
>
>>Second, Windows is a bug ridden (P)OS with limited capabilities and
>>major architectural flaws. Instead of fixing the architecture or
>>flaws, they continue to build new, major revision versions. MS has
>>shown that their only dedication if to their wallet, not to producing
>>a quality product.

>
>Microsoft is in a catch 22 situation. To make money, they need to sell
>new products. Without money, they can't do anything. Would you be
>willing to pay for Service Patches to XP? Right now, all the XP
>continuing support is not being paid for by sales of XP. Without new
>products, there would be no continued support for XP and the Windows
>world be a much gloomier place than it is.

Thanks
Juan I. Cahis
Santiago de Chile (South America)
Note: Please forgive me for my bad English, I am trying to improve it!
 
On Fri, 20 Jul 2007 12:41:48 -0400, Juan I. Cahis
<jiclbchSINBASURA@attglobal.net> wrote:

>Maybe only a little reduction of their huge profits (isn't Bill one of
>the five most richest people in the World?) would increase the quality
>of their Service Patches to XP (and the related customer care) a lot.


I believe Bill is the number 1 richest person in the world. Even so,
where does the money for new development come from? Do you expect all
the 'richer' people at MS to put their own money into XP? No, they are
going to use corporate money, and that won't come from old products
nearing the end of their profitability cycle.

--
Zilbandy
 
Zilbandy wrote:

> On Fri, 20 Jul 2007 12:41:48 -0400, Juan I. Cahis
> <jiclbchSINBASURA@attglobal.net> wrote:
>
>
>>Maybe only a little reduction of their huge profits (isn't Bill one of
>>the five most richest people in the World?) would increase the quality
>>of their Service Patches to XP (and the related customer care) a lot.

>
>
> I believe Bill is the number 1 richest person in the world. Even so,
> where does the money for new development come from? Do you expect all
> the 'richer' people at MS to put their own money into XP? No, they are
> going to use corporate money, and that won't come from old products
> nearing the end of their profitability cycle.
>


Nope not anymore.
http://news.com.com/2100-1001-239838.html
 
Bill's now only the second richest person in the world. Some Mexican
gazzilionare beat him out this year, mostly because Bill has recently given
away so much in charity.

--
Gary S. Terhune
MS-MVP Shell/User
www.grystmill.com

"Zilbandy" <zil@zilbandyREMOVETHIS.com> wrote in message
news:pbr1a31ou9q7m52qodbk32rbvc452phkk3@4ax.com...
> On Fri, 20 Jul 2007 12:41:48 -0400, Juan I. Cahis
> <jiclbchSINBASURA@attglobal.net> wrote:
>
>>Maybe only a little reduction of their huge profits (isn't Bill one of
>>the five most richest people in the World?) would increase the quality
>>of their Service Patches to XP (and the related customer care) a lot.

>
> I believe Bill is the number 1 richest person in the world. Even so,
> where does the money for new development come from? Do you expect all
> the 'richer' people at MS to put their own money into XP? No, they are
> going to use corporate money, and that won't come from old products
> nearing the end of their profitability cycle.
>
> --
> Zilbandy
 
They bacame "richer" because Microsoft gave too much money to them,
most probably through dividends, instead to spend a little more
corporate money in customer care and satisfaction.

Zilbandy <zil@zilbandyREMOVETHIS.com> wrote:

>On Fri, 20 Jul 2007 12:41:48 -0400, Juan I. Cahis
><jiclbchSINBASURA@attglobal.net> wrote:
>
>>Maybe only a little reduction of their huge profits (isn't Bill one of
>>the five most richest people in the World?) would increase the quality
>>of their Service Patches to XP (and the related customer care) a lot.

>
>I believe Bill is the number 1 richest person in the world. Even so,
>where does the money for new development come from? Do you expect all
>the 'richer' people at MS to put their own money into XP? No, they are
>going to use corporate money, and that won't come from old products
>nearing the end of their profitability cycle.

Thanks
Juan I. Cahis
Santiago de Chile (South America)
Note: Please forgive me for my bad English, I am trying to improve it!
 
On Fri, 20 Jul 2007 09:15:16 -0700, Zilbandy
<zil@zilbandyREMOVETHIS.com> wrote:

>
>Microsoft is in a catch 22 situation. To make money, they need to sell
>new products. Without money, they can't do anything. Would you be
>willing to pay for Service Patches to XP? Right now, all the XP
>continuing support is not being paid for by sales of XP. Without new
>products, there would be no continued support for XP and the Windows
>world be a much gloomier place than it is.



For years users paid major firms for new releases of improved OS's.
Those OS's would be improved, not replaced. Bugs were always repaired
for free. The firm would take a risk and invest it's money in the next
OS release, hoping it would sell.

It's no different for MS. The difference is that they insist on
rewriting from the ground up. They start with a shaky foundation, they
plug the holes for a while, and instead of fixing it, and improving
it, and making it more solid, they build a whole new building each
time.
 
Back
Top