rename_files_by_age

Automatically rename files by age from a set date. I use it to date pictures and videos of my kid.
346 Downloads
Aktualisiert 12 Aug 2013

Lizenz anzeigen

% function rename_files_by_age()
%
% function to automatically rename pictures and videos to start with age
% from specified date. Written for baby pictures.
% Example: Changes name from 'foo' to '##Y##M##D_foo'
% ie - 'foo.jpg' to '01Y03M10D_foo.jpg' if pic taken 1 year, 3 months, 10
% days after birth
%
% I tried to keep it simple, so I just copy it into a folder with files I
% want to rename and then run it
% I put all video files in a subfolder called 'videos'
% change variable folder_videos below if you do something different
%
% my files came from many different sources
% (iPhone, android phone, multiple cameras, ipcamera)
% and they don't all have the same info, so here's what I came up with
% for *.jpg pictures:
% - I try exifread to get DateTimeOriginal
% - if that doesn't work, I use imfinfo to get FileModDate
% for videos:
% 1. *.3gp files from android phone
% -named as VID_YYYYMMDD_HHMMSS.3gp
% -just use the date from the original filename
% 2. *.mp4 files from android phone
% -named as YYYYMMDD_HHMMSS.mp4
% -I use picasa, which doesn't like mp4 files, so I rename as .mov
% -then just use the date from the original filename
% 3. *.avi files from digital camera
% - not ideal b/c only have access to last change date, not date created...
% would be a problem if only upload videos from camera rarely
% 4. *.mov files from iphone
% - not ideal b/c only have access to last change date, not date created...
% would be a problem if only upload videos from iphone rarely
% 5. *.wmv files from webcam
% - not ideal b/c only have access to last change date, not date created...
%
% v1 - Nathan Tomlin. Feb 12, 2012. nathan.a.tomlin@gmail.com
% v2 - Feb 28, 2012. Fixed error in .jpg renaming and added .wmv check
% v3 - Aug 11, 2013. Fixed error in age rename and added .mp4 check

Zitieren als

Nathan Tomlin (2024). rename_files_by_age (https://www.mathworks.com/matlabcentral/fileexchange/35052-rename_files_by_age), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2007a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Just for fun finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Veröffentlicht Versionshinweise
1.2.0.0

fixed an error and added mp4 video check.

1.1.0.0

Feb 28, 2012. Fixed error in .jpg renaming and added .wmv check

1.0.0.0