Sunday, November 16, 2014

Consolidating Madness

I'm pulling music files from the My Cloud drive into my master folder structure on the external hard drive in an effort to weed out duplicates. In doing so, I feel like I'm doing the same work over and over because I think I've done exactly the same type of merging previously. For example, in the folder structure where the .txt files for my MS DOS files are stored, my code used to put the day in front of the month as in creating a folder for December 5, 2013 in this format: 2013_05_12. At some time in the reconversion, I decided to change the code for my folders to be in this format: 2013_12_05. I'm not sure if one is better than the other, but that's what I did. This means that when I merge these .txt files into the "master" folder structure, I have both folders:
2013_05_12 <-- old format
2013_12_05 <-- new format
My methodology is to rename 2013_05_12 to 2013_12_05 and, of course, that means I end up with (2) files in that folder structure (Windows' way of saying that there is a second file with the same name). I do have a separate MS DOS batch file that deletes all my duplicate files as it looks for files named *(2).* through *(40).* and deletes them without manual intervention.

On the same subject as changing my MS DOS batch file code, I just made a change to the code to include the current date in the file name that is created. I don't know why I waited until now, when I'm nearly done with the reconversion, to do this except to say that I never thought of it until this morning. Here's the revised code:
|
REM | 20131230
REM | Create date folder
cd\
f:
cd f:\music_shell
cd f:\music_shell\(_______Date
SET Today=%Date:~10,4%_%Date:~4,2%_%Date:~7,2%
mkdir %today%
REM | Begin commands for the entire music_shell folder
cd\
f:
cd music_shell
dir F:\music_shell\*.flv *.mp4 *.web* /s /od >f:\music_shell\(_______Date\%today%\%today%_videofiles_music_shell_2TB.txt
dir F:\music_shell\*___* *-* *_* *___* *--* /s /od >f:\music_shell\(_______Date\%today%\%today%_needtofix_music_shell_2TB.txt
dir F:\music_shell\a* b* c* d* e* f* g* h* i* j* k* l* m* n* o* p* q* r* s* t* u* v* w* x* y* z* >f:\music_shell\(_______Date\%today%\%today%_allfolders_music_shell_2TB.txt
dir F:\music_shell\*.mp3 *.wav *.wma /s /od>f:\music_shell\(_______Date\%today%\%today%_mostrecentcount_music_shell_2TB.txt
REM | Begin commands for the music_reconversion folder
cd\
f:
cd Music_shell\music_reconversion_E_DR
dir F:\Music_shell\music_reconversion_E_DR\*.mp3 *.wav *.wma /s /od>f:\music_shell\(_______Date\%today%\%today%_mostrecentcount_Music_reconversion_2TB.txt
dir F:\Music_shell\music_reconversion_E_DR\*.flv *.mp4 *.web* /s /od>f:\music_shell\(_______Date\%today%\%today%_videofiles_Music_reconversion_2TB.txt
dir F:\Music_shell\music_reconversion_E_DR\*___* *-* *_* *___* *--* /s /od >f:\music_shell\(_______Date\%today%\%today%_needtofix_Music_reconversion_2TB.txt
dir F:\Music_shell\music_reconversion_E_DR\a* b* c* d* e* f* g* h* i* j* k* l* m* n* o* p* q* r* s* t* u* v* w* x* y* z* >f:\music_shell\(_______Date\%today%\%today%_allfolders_Music_reconversion_2TB.txt
cd\
f:
cd music_shell
dir *.* /s >f:\music_shell\(_______Date\%today%\%today%_allfiles_Music_shell_2TB.txt
cd\
dir *.* /s >f:\music_shell\(_______Date\%today%\%today%_allfiles_2TB.txt
|
The result of this code is the date is in the file name. Yesterday, I had files like this:
Directory of F:\Music_shell\(_______Date\2014_11_15
11/15/2014  03:59 PM        18,467,635 allfiles_2TB.txt
11/15/2014  03:58 PM         9,080,126 allfiles_Music_shell_2TB.txt
11/15/2014  03:58 PM           170,902 allfolders_Music_reconversion_2TB.txt
11/15/2014  03:57 PM             1,115 allfolders_music_shell_2TB.txt
11/15/2014  03:57 PM         6,914,594 mostrecentcount_Music_reconversion_2TB.txt
11/15/2014  03:57 PM         6,914,594 mostrecentcount_music_shell_2TB.txt
11/15/2014  03:58 PM         8,158,170 needtofix_Music_reconversion_2TB.txt
11/15/2014  03:57 PM         8,497,847 needtofix_music_shell_2TB.txt
11/15/2014  03:57 PM             2,021 videofiles_Music_reconversion_2TB.txt
11/15/2014  03:57 PM             2,021 videofiles_music_shell_2TB.txt
|
and today, the same code I run gives me this:
|
Directory of F:\Music_shell\(_______Date\2014_11_16
11/16/2014  08:05 AM        22,781,984 2014_11_16_allfiles_2TB.txt
11/16/2014  08:05 AM        13,390,516 2014_11_16_allfiles_Music_shell_2TB.txt
11/16/2014  08:05 AM           170,900 2014_11_16_allfolders_Music_reconversion_2TB.txt
11/16/2014  08:04 AM             1,115 2014_11_16_allfolders_music_shell_2TB.txt
11/16/2014  08:04 AM         6,943,576 2014_11_16_mostrecentcount_Music_reconversion_2TB.txt
11/16/2014  08:04 AM         9,425,363 2014_11_16_mostrecentcount_music_shell_2TB.txt
11/16/2014  08:05 AM         8,181,281 2014_11_16_needtofix_Music_reconversion_2TB.txt
11/16/2014  08:04 AM        12,033,726 2014_11_16_needtofix_music_shell_2TB.txt
11/16/2014  08:04 AM             2,021 2014_11_16_videofiles_Music_reconversion_2TB.txt
11/16/2014  08:04 AM             4,922 2014_11_16_videofiles_music_shell_2TB.txt
|
Just another way that I geek out when I write MS DOS code!

No comments: