Conversation
Notices
-
got some files w format screenshot_mmddyyyy_hhmmss.PNG - command to create folder with date (yymmdd) and move files there? !linux
-
@uvok quick python script for that: http://pastebin.com/m2d98ec82
uvok ch337ah likes this. -
@rxp thanks, but it says SyntaxError: 'return' outside function
-
@uvok huh, thats really strange, it worked when I tested it. maybe pastebin messed up the indentation :(
-
@rxp in line 24
-
@uvok if you use the download link on the pastebin page, and rename the file to .py, it works
-
@rxp if I want to execute it with ./move_files.py (chmod +x done), it says bash: ./move_files.py: /usr/bin/env: bad interpreter: no permissi
-
@rxp but it works when I run python move_files.py
-
@uvok one way fwiw: perl -e 'for(`ls screenshot*.PNG`){chomp;($m,$d,$y)=$_=~/_(\d\d)(\d\d)\d\d(\d\d)_/;mkdir "$y$m$d";`mv $_ "$y$m$d"`}'
-