I am going to describe a problem that I am trying to solve. If you have a solution that you can suggest to me, please email me.
Let's say that I have a bunch of files (say, 100 or 1000) in a directory. And I want to copy a few (say 10) of those to another directory. But I want to have those 10 chosen at random. And I want to be able to perform this action frequently in Windows, so I want it to be automated.
Does anyone have a suggestion for how to do this? All of the "programming" I have been doing recently has been in Matlab. And I think I have an idea for how to perform this action in a script using Matlab (although I'm not exactly sure). But I don't want to have to fire up Matlab all of the time just to copy a bunch of files. Right now, that's my plan B. One advantage to using Matlab is that I could use one command and get a list of all of the files in the directory (eliminating half the work):
listoffiles = dir('c:\temp');I tried to figure out how to implement this in a .bat file, but I quickly became confused with .bat file programming.
I could also break out my C/C++ books and figure out how to write this function. One advantage to using C is that I could compile the program into an .exe. Then I could execute the .exe without having to load a huge thing into memory (unlike Matlab).
Anyone have any ideas?
Labels: computers



<< Home