« Installshield Installer Needed | Home | Ex4 To Mq4 Decompiler »
Rename File To Folder Name
By admin | July 26, 2008
I’m looking for an application that will locate a file type inside a folder, and rename the file to the name of the folder.
I may have 100 unique folders, inside every unique folder will be a single .txt file. I want that text file renamed the name of the folder, and then moved to the root of the folder.
For example turn this:
c:\download\folder.number.1\readme.txt
c:\download\folder.number.2\thanks.txt
c:\download\folder.number.3\hello.txt
c:\download\folder.number.4\hi.txt
c:\download\folder.number.5\folder.txt
Into this:
c:\download\folder.number.1.txt
c:\download\folder.number.2.txt
c:\download\folder.number.3.txt
c:\download\folder.number.4.txt
c:\download\folder.number.5.txt
If there are more than one .txt files inside a folder simply add a number to it, for example folder.name.txt to folder.name.1.txt or folder.name.1.2.txt
So, find the .txt file, rename the .txt file, and move it up a folder.
If anyone can provide a working sample (its okay to use different than txt files in the sample) I will probably pick you.
Topics: C/C++ |