2024-01-17, 05:24 PM
(This post was last modified: 2024-01-17, 05:34 PM by tmsrxzar. Edited 2 times in total.)
i did this to move single movie files to a subfolder of the same name
movie.title.here.2008.mkv -> movie.title.here.2008/movie.title.here.2008.mkv
can be modded to do movie.title.here.2008.*
*edit: only for linux
bash:
python:
movie.title.here.2008.mkv -> movie.title.here.2008/movie.title.here.2008.mkv
can be modded to do movie.title.here.2008.*
*edit: only for linux
bash:
Code:
for f in *.mkv; do
mkdir ${f//.mkv/}
echo mv "$f" ${f//.mkv/}/
done
python:
Code:
import os, re
for e in os.listdir('.'):
if '.mkv' in e:
dname = re.split('(\.\d{4})(.*)',e)
dname = '%s%s' % (dname[0],dname[1])
try:
os.mkdir(dname)
except: pass
os.system('mv ./%s ./%s/' % (e, dname))