Jul
1
How do I move files to a directory based on the filename?
Filed Under cyprusbizdirectory | 3 Comments
I want to sort/move files in a batch process to a directory named X, where X is the first 13 characters of the filename. How do I do this?
For clarification, I need to do this for about 50,000 files and I haven’t coded in about 5 years, and what I did do was strictly amateur and non-complex. I’m working in a Windows XP Professional environment.
I guess I wasn’t too clear about what I wanted to do. I want to take all the files in a folder and then move them into subdirectories that are based on the first 13 characters of the file’s name. This will be done for multiple folders.
So, for example, I might have a folder named Bob. Bob has 5,000 files in it. These 5,000 files need to be sorted into about 20 folders which have names that are equivalent to the truncated filenames.
So, if X = First 13 characters of Filename of File, then I want to:
Move File into Folder, where Foldername = X
Either a application-based, windows-based, or code-based solution is acceptable, and I didn’t name a specific programming language because I’m essentially proficient in nothing, otherwise this would be trivial.
Amanda
