Solved BULK creating of folders based on file names, and then moving files in

JPnottosure

New member
Local time
10:22 AM
Messages
2
Hi Everyone,

i have been looking for weeks for a way to do this and i have tried so many applications but i just cant seem to get it right, i was hoping that you guys my be able to help me out here with this one..

i have two folders, at the moment with identical file names in the ( they are images names are the same but one is a before and one an after ) and i need to move them into a third folder but create a file based on the image name and then a sub file for them image from folder one called ALT_1 and for the after shot subfolder but separate folder ALT_2

so the two inputs would be for each image
\Desktop\DNA-RAW\a01052.jpg
\Desktop\DNA-AFTER\a01052.jpg

output folder would be
\Desktop\DNA-FINAL\a01052\ALT_1\a01052.jpg (raw shot)
\Desktop\DNA-FINAL\a01052\ALT_2\a01052.jpg (after shot)

ive never done any programing before and im really stuck on how to sort these two out .. any help anyone can give would be really appreciated, or even if you can point me in the direction of an application that i can use for this one that would be awesome

oh yeah BTW i am running win 7 64 bit..

thanks so much in advance

JP !
 

My Computer My Computer

At a glance

Wn 7 64i7 -2630 QM32GBNvidia GT540M 2GB
Computer type
Laptop
Computer Manufacturer/Model Number
ASUS N532
OS
Wn 7 64
CPU
i7 -2630 QM
Memory
32GB
Graphics Card(s)
Nvidia GT540M 2GB
Hard Drives
750 GB
Browser
Chrome
Hi JP and welcome to SevenForums!

I'm sure I or someone else here can create a batch file for you for this. Some questions:

We basically only need to loop through all files in the DNA-RAW folder, assuming that DNA-AFTER holds the same file names?
Is it all files or only jpg?
DNA-RAW = ALT_1
DNA-AFTER = ALT_2
And the files should be moved, not copied.
 

My Computer My Computer

At a glance

Windows 7 Pro 32Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz4,00 GB (Usable 2,98)NVIDIA NVS 5100M
Computer type
Laptop
Computer Manufacturer/Model Number
HP Elitebook 8540p
OS
Windows 7 Pro 32
CPU
Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz
Motherboard
Hewlett-Packard 1521
Memory
4,00 GB (Usable 2,98)
Graphics Card(s)
NVIDIA NVS 5100M
Sound Card
NVIDIA High Definition Audio
Screen Resolution
1600x900
Hard Drives
INTEL SSDSA2CW120G3
Antivirus
F-Secure Internet Security
Browser
IE, Firefox, Opera
Other Info
Sandboxie,
SRP (Software Restriction Policy),
EMET (Enhanced Mitigation Experience Toolkit),
WFC (Windows Firewall Control by BiniSoft),
Malwarebytes Premium
Hi Tookeri !

Copied or moved is fine, i can back them up before i anything so which ever is easier.. the thing that concerns me is that a file needs to be created within the

\Desktop\DNA-FINAL\

destination of the file name, and then within that file ALT_1 needs be created and then the first file moved,

\Desktop\DNA-FINAL\a01052\ALT_1\a01052.jpg

where is in the second image shares the sub file,

\Desktop\DNA-FINAL\a01052\

but still needs to have the file ALT_2 created and then the second image inserted into it..

sorry if im spelling it all out super basically, im not sure if i explained it properly the first time, and im sure for some one who know it seems super easy but to me i have 1000' of each of these images and im a bit confused on what would be the best move :confused:
 

My Computer My Computer

At a glance

Wn 7 64i7 -2630 QM32GBNvidia GT540M 2GB
Computer type
Laptop
Computer Manufacturer/Model Number
ASUS N532
OS
Wn 7 64
CPU
i7 -2630 QM
Memory
32GB
Graphics Card(s)
Nvidia GT540M 2GB
Hard Drives
750 GB
Browser
Chrome
You keep saying file and sub file but you mean folder and sub-folder, right?

I have to go now but I'll try to look at it tomorrow or the day after (unless someone else beats me to it)
 

My Computer My Computer

At a glance

Windows 7 Pro 32Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz4,00 GB (Usable 2,98)NVIDIA NVS 5100M
Computer type
Laptop
Computer Manufacturer/Model Number
HP Elitebook 8540p
OS
Windows 7 Pro 32
CPU
Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz
Motherboard
Hewlett-Packard 1521
Memory
4,00 GB (Usable 2,98)
Graphics Card(s)
NVIDIA NVS 5100M
Sound Card
NVIDIA High Definition Audio
Screen Resolution
1600x900
Hard Drives
INTEL SSDSA2CW120G3
Antivirus
F-Secure Internet Security
Browser
IE, Firefox, Opera
Other Info
Sandboxie,
SRP (Software Restriction Policy),
EMET (Enhanced Mitigation Experience Toolkit),
WFC (Windows Firewall Control by BiniSoft),
Malwarebytes Premium
Hey guys,

Forgive me Tookeri, but allow myself to beat you to it ;).

JPnottosure, I'm going to assume that you in fact meant 'folder' instead of 'sub\file' that you mentioned multiple times in your previous post, as Tookeri has pointed above.

I'm also guessing that the contents of 'Desktop\DNA-RAW' and 'Desktop\DNA-AFTER' are exactly identical. If that is the case, then this batch file may satisfy your aim:

Code:
@echo off
cd %USERPROFILE%\Desktop
 
:: Sorting images in '\Desktop\DNA-RAW'
for /f "delims=" %%I in (' dir /b "%USERPROFILE%\Desktop\DNA-RAW\*.jpg" ') do (
    if not exist "%USERPROFILE%\Desktop\DNA-FINAL\%%~nI\ALT_1" ( md "%USERPROFILE%\Desktop\DNA-FINAL\%%~nI\ALT_1" )
    move "%USERPROFILE%\Desktop\DNA-RAW\%%~I" "%USERPROFILE%\Desktop\DNA-FINAL\%%~nI\ALT_1\"
)
 
:: Sorting images in '\Desktop\DNA-AFTER'
for /f "delims=" %%I in (' dir /b "%USERPROFILE%\Desktop\DNA-AFTER\*.jpg" ') do (
    if not exist "%USERPROFILE%\Desktop\DNA-FINAL\%%~nI\ALT_2" ( md "%USERPROFILE%\Desktop\DNA-FINAL\%%~nI\ALT_2" )
    move "%USERPROFILE%\Desktop\DNA-AFTER\%%~I" "%USERPROFILE%\Desktop\DNA-FINAL\%%~nI\ALT_2\"
)
exit

Place this batch file anywhere on your system and run it.
 

Attachments

My Computer My Computer

At a glance

Windows 10, Windows 8.1 Pro, Windows 7 Profes...
Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
You're excused ;) Nice work! Tested and approved!

I didn't see that coming, that a new member would appear only for this. But I see you had a "down under" advantage of being able to work while I was asleep :p

Welcome to the forum Pyprohly!
 

My Computer My Computer

At a glance

Windows 7 Pro 32Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz4,00 GB (Usable 2,98)NVIDIA NVS 5100M
Computer type
Laptop
Computer Manufacturer/Model Number
HP Elitebook 8540p
OS
Windows 7 Pro 32
CPU
Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz
Motherboard
Hewlett-Packard 1521
Memory
4,00 GB (Usable 2,98)
Graphics Card(s)
NVIDIA NVS 5100M
Sound Card
NVIDIA High Definition Audio
Screen Resolution
1600x900
Hard Drives
INTEL SSDSA2CW120G3
Antivirus
F-Secure Internet Security
Browser
IE, Firefox, Opera
Other Info
Sandboxie,
SRP (Software Restriction Policy),
EMET (Enhanced Mitigation Experience Toolkit),
WFC (Windows Firewall Control by BiniSoft),
Malwarebytes Premium
Back
Top