Print this page | Go back to previous topic
Forum nameThe Computer Forum
Topic subjectProgram to sort files by "name" into folders
Topic URLhttp://www.pcqanda.com/dc/dcboard.php?az=show_topic&forum=2&topic_id=2444
2444, Program to sort files by "name" into folders
Posted by happyware, Mon Dec-17-01 11:21 PM
for example if I had 5000 pictures in a directory and I wanted to place them in numbered folders (named 0-9) and sort them into these folder.

For example all files with "_02" I want to place into the folder called "C:\2\" and so on.

I know the long way.... (using the find command in the folder where the images or files appear) but this is something I want done automatically. Anysoftware that would allow this by clicking a few buttons? I don't have trouble doing basic scripts (if the program is well documented) and I'm in the process of working on a windows type program for this purpose but until then I'm pretty stuck.

Hopefully a solution exists! =-)




2445, check in here:
Posted by Ropera, Mon Dec-17-01 11:28 PM
http://www.nonags.com/mirrors.html

there are some proggies to rename multiple files.
2446, RE: Program to sort files by "name" into folders
Posted by SteveYandl, Tue Dec-18-01 12:33 AM
This could be done fairly easily with a visual basic script using the file system object. You iterate through the collection of files in the named target folder and use "select..case" along with the InStr function and filecopy to act on the files.

Are the folders already present?
Are the files you're going to separate in a single folder or a collection of subfolders?
Are you wanting to move or copy the files and how do you want to handle over-writes?
Are you wanting to run the script from command line, double click, or drag and drop?
2447, RE: Program to sort files by
Posted by NytOwl, Tue Dec-18-01 05:55 AM
When you have these files displayed in the right hand window of Explorer, can't you click on the Name button above the column of file names to organize them by name, then Cut/Paste them a group at a time into the folders.

(The toolbar above the files will have buttons for Name | Size | Type | Modified | Attributes|)

NytOwl
2448, RE: Program to sort files by
Posted by EdHart, Tue Dec-18-01 05:39 PM
happyware,maybe your computer is different than mine. If I simply put the files in a folder, exit the folder, then return to the folder, the files are automatically in alphabetical order. Sounds to me like your biggest problem is getting the files there in the first place.??
Ed.

Simply select one,then press ctrl on each of the others you would like to select and then choose 'Edit' and move the files to whatever folder you like.
2449, RE: Program to sort files by
Posted by SteveYandl, Tue Dec-18-01 08:26 PM
Ed,

I think that the challenge for happyware is that the songs might be like:

The rock song_02.mp3
A country song_04.mp3
New rock song_06.mp3

If the criteria for sorting into one of the ten folders 01-10 is the presence of the correct two digit marker as part of the title but the numbers are not at the front of the file label, then a file sort will not make the organization any easier. In script, you have various text functions that allow you to return the position of a substring. You can use that tool to determine if a certain substring is present or not and use that condition as a sorting device.

The script would be easy to do but it takes enough time to do that I'll wait to make sure that happyware is still around before I write it up.