advertisement
Forums

The Forum is sponsored by 
 

AAPL stock: Click Here

You are currently viewing the Tips and Deals forum
How to sort lots of files in folders? (Windows 2000 or XP)
Posted by: space-time
Date: January 02, 2010 06:51PM
I have a process at work, and every 4-5 minutes a couple of files are generated.

The software is designed to places these files in a certain folder, and I could ask the operator to make a new folder about once an hour when they start a new part, but I tried this and it never works properly... they mess up the folder name, or the location of the folder.

So right now the files to in D:\logs and this folder has thousands of files usually grouped in 10 (10 parts per product)

D:\Logs contains:

SN00001_component01
SN00001_component02
...
SN00001_component10
SN00002_component01
SN00002_component02
....

SN1850_component01
SN1850_component02
etc

I would like to sort them in folder, each 10 files to be sorted in a folder called SN00xyz

On top of that, would be nice of I could sort these folders in groups of 100

000 would contain all the parts from 000 to 099
100 would hold the 100-199, etc

So these files would end up nested like this

D:\Logs\000\SN001\SN001_component01
D:\Logs\000\SN001\SN001_component02
...
D:\Logs\000\SN079\SN079_component01
...
D:\Logs\1800\SN1850\SN1850_component01
D:\Logs\1800\SN1850\SN1850_component02
D:\Logs\1800\SN1850\SN1850_component03
D:\Logs\1800\SN1850\SN1850_component04

etc

How can I do this?

I could probably do it in AppleScript or Automator, but I could prefer something I could do in Windows.

Thanks
Options:  Reply • Quote
Re: How to sort lots of files in folders? (Windows 2000 or XP)
Posted by: Filliam H. Muffman
Date: January 03, 2010 12:05AM
I would be tempted to do it manually and get it over with but there might be a file management utility that can do it. Pipe a DIR command to a batch file and then do some editing.

dir:> d:\logs *.* > copy.bat

Now open the file with your "fav" text editor, like Notepad.

with find and replace add "copy" (find "sn" : replace "copy sn" ) to the beginning of every line and at the end " d:\logs\0000\sn0000\."

every 10 lines use find and replace 10 times to change " d:\logs\000\sn000\." to " d:\logs\0000\sn0010\."

then every 100 lines change to " d:\logs\0100\sn0100\." Edit: I can add more detail if you don't understand DOS commands



It might be possible to make a batch file that copies the files or makes a new directory depending on how the program is started.



In tha 360. MRF User Map



Edited 3 time(s). Last edit at 01/03/2010 12:08AM by Filliam H. Muffman.
Options:  Reply • Quote
Re: How to sort lots of files in folders? (Windows 2000 or XP)
Posted by: space-time
Date: January 03, 2010 08:08AM
thanks, that's a good start. will try it this week
Options:  Reply • Quote
Re: How to sort lots of files in folders? (Windows 2000 or XP)
Posted by: space-time
Date: January 03, 2010 08:10AM
"I would be tempted to do it manually and get it over with..."

about 100 files are generated every day, for 10 products or so, and it would be a pain to do it manually, especially going back to all those 2000 products made so far... maybe I can assign a poor Intern to do this task ")
Options:  Reply • Quote
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 204
Record Number of Users: 186 on February 20, 2020
Record Number of Guests: 5122 on October 03, 2020