I ask for help regarding some scripting.
I have a directory "J:\To_Sort" which contains another 1164 directories. Inside the "To_Sort" directory I also have 37 *.md5 files. These MD55 files contain the checksum and the original paths to every single file & directory. They are named:
I would like to restore the directory structure based on the .md5 files. So I'd have something like:
- J:\To_Sort\Selected-Dir-01\all the directories & files that were originally here
- J:\To_Sort\Selected-Dir-02\all the directories & files that were originally here
- J:\To_Sort\Selected-Dir-03\all the directories & files that were originally here
Here is the content of an md5 file:
D754CEE4296B03062E53EA0FF7859F53 *photos\Foley_At_141_-_14-04-2009\small-psd\DSC_7975 copy.psd
The first section is a checksum, followed by a space. Then the asterisk denotes the start of the directory structure and file path. A CR denotes a new line in the MD5 file. MD5 files were created by FastSum command line edition
I found something here that could lead to a solution. (I'm not too familiar with Ruby, but I'm now dissecting the code.)
I started thinking about solutions and I think I'm overcomplicating it. (Writing a macro in UltraEdit to remove the CRC values from .md5s, replace asterisk with destination directory path, then write a batch file... I'm sure that there is a better solution.)
I have OS X Snow Leo (with Xcode) & Windows XP Home.
EDIT: As codelahoma quite rightly pointed out, I forgot to mention that the file names and the folder structure are intact. (They are the same as they are listed in the .MD5 files)
So This was the original structure (which I would like to regain):
This is the current structure:
Allowed characters in filename and extension: as per ISO9660/Joliet (Mode 2) standard.
I am eternally grateful for a solution!