Skip to main content

Divide photos from mobile to different folders


If photos are of name  20171114_175035.jpg you can divide them into different folders according dates.

Run below commands on photos folder.

rem copy pictures images movies camera/mobile phone to sub folders pics photos

rem ##### make folders according dates of images #####
dir /b *.jpg | sed -e "s/^\(....\)\(..\)\(..\)_\(.\).*/mkdir \1_\2_\3_\4/g" | uniq  |sort > c1.bat
c1.bat

rem #### move images to folders #####
dir /b *.jpg | sed -e "s/^\(....\)\(..\)\(..\)_\(.\).*/move \0 \1_\2_\3_\4/g"  > c2.bat
c2.bat

rem #### make folders for movies #####
dir /b *.mp4 | sed -e "s/^\(....\)\(..\)\(..\)_\(.\).*/mkdir \1_\2_\3_\4/g" | uniq  |sort > c1.bat
c1.bat

dir /b *.mp4 | sed -e "s/^\(....\)\(..\)\(..\)_\(.\).*/move \0 \1_\2_\3_\4/g"  > c2.bat
c2.bat

dir /b *.avi | sed -e "s/^\(....\)\(..\)\(..\)_\(.\).*/mkdir \1_\2_\3_\4/g" | uniq  |sort > c1.bat
c1.bat

dir /b *.avi | sed -e "s/^\(....\)\(..\)\(..\)_\(.\).*/move \0 \1_\2_\3_\4/g"  > c2.bat
c2.bat



del c1.bat
del c2.bat




dir /b *.jpg | sed -e "s/^\(..........\).*/mkdir \1/g" | uniq  |sort > c1.bat
c1.bat

dir /b *.jpg | sed -e "s/^\(..........\)\(.*\)/move """\1\2""" \1/g" | sort > c2.bat
c2.bat

dir /b *.mp4 | sed -e "s/^\(..........\).*/mkdir \1/g" | uniq  |sort > c3.bat
c3.bat

dir /b *.mp4 | sed -e "s/^\(..........\)\(.*\)/move """\1\2""" \1/g" | sort > c4.bat
c4.bat

dir /b *.avi | sed -e "s/^\(..........\)\(.*\)/move """\1\2""" \1/g" | sort > c5.bat
c5.bat

del c1.bat
del c2.bat
del c3.bat
del c4.bat
del c5.bat



Comments

Popular posts from this blog

Best freeware - XML editor

As a software developer, I open XML files all the time. I a heavy commercial XML editor. But nothing can compare to a small, thin and free XML editor like 'foxe'. A great feature is has is the alignment of long XML strings to readable XML format (Shift-F8). It help lot of times when the XML file was generated by some tool and was not readable. Homepage: http://www.firstobject.com/dn_editor.htm

Jenkins error: groovy.lang.MissingPropertyException

I tried to run groovy build step and got below error. This post will describe how I solved the problem. Caught: groovy.lang.MissingPropertyException: No such property: hudson for class: script

SSL in pictures

Here is my summary on SSL (or as I like to call it 'SSL for dummies')