Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Mass File Renaming
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
romantic_programmer




PostPosted: Mon Dec 15, 2008 2:50 am   Post subject: Mass File Renaming

Problem: I have several thousand photos with in an array of folders. i am looking for help to design a program that will allow me to rename the files one folder at a time. So just say all the files in folder A are random numbers. i would like to take this folder and change all the file names to birthdayparty(*)

* = a increment number to prevent duplicate file nameing

I am just having a problem on how to start it.... i know i need to use the File manipulation module, and maybe a few for statements or loops...

if someone could help me in the right direction this would be a huge time saver.

ok i edited this message and so far this is what i have come up with...


code:
/*
* Must place this file into the Directory in
* which you wants it's files to be rewritten
*/

var inc : int := 0
var newName : string := ""
var genericFile : string

put "Welcome, to your file name changer"
loop
File.Rename ("\""+ genericFile + "\"" + ".jpg", "\""+ newName + "\"" + inc + ".jpg")
inc += 1
end loop
put Error.LastMsg
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Mon Dec 15, 2008 2:06 pm   Post subject: RE:Mass File Renaming

Look up Dir.Open() Dir.Get() and of course Dir.Close(), those should give you everything necessary to finish your program.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: