Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb Site ManagementScripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 2nd, 2007, 06:01 PM
snakedoctor snakedoctor is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 3 snakedoctor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 40 sec
Reputation Power: 0
Batch File - rename 220 files

Hi,

I am running Windows Vista Home Premium.

I have a directory that contains 220 files that I want to rename.

The format of some files are as follows:

fileName fileNumber fileSecondaryName (common name).txt

Other files are like:
file Name fileNumber fileSecondaryName (common.name).txt


The only differences are the space in "file name" at the beginning and a period in between the two words in the brackets.

I am after a script that will rename these files by deleting the "fileName or "file name"" and "(common name)" or "(common.name)", including the brackets, from the file name.

That is to:
fileNumber fileSecondaryName.txt



Can anyone help?


Regards
Noobie

Thank you

Reply With Quote
  #2  
Old October 5th, 2007, 05:55 AM
snakedoctor snakedoctor is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 3 snakedoctor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 40 sec
Reputation Power: 0
I have been just thinking. It doesn't have to be a windows batch script. I will accept a program in any language as long as it does the job.

Reply With Quote
  #3  
Old October 5th, 2007, 08:55 AM
tj_nt tj_nt is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Posts: 1,616 tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level)tj_nt User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 20 h 31 m 37 sec
Reputation Power: 635
I am not sure I understand your request...

can you give an exact example of some of the actual file names?

you may not need a script unless this task is going to be needed to be repeated...you may be able to use a "find and replace" application?

Reply With Quote
  #4  
Old October 5th, 2007, 01:55 PM
snakedoctor snakedoctor is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 3 snakedoctor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 40 sec
Reputation Power: 0
Quote:
Originally Posted by tj_nt
I am not sure I understand your request...

can you give an exact example of some of the actual file names?

you may not need a script unless this task is going to be needed to be repeated...you may be able to use a "find and replace" application?


Yes this task will need to be repeated on a regular basis but where the file names are slightly different but follow a similar format.

So something which I can edit, if needed, would be ideal.

Here are some actual file names:

testScript [2x01] add new sales record (asd.open)
testScript [2x02] delete existing sales record (asd open)
testScript [2x03] modify existing sales record (asd.open)

Thank you in advance.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > Batch File - rename 220 files


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway