Code covered by the BSD License  

Highlights from
rename_files_by_age

Be the first to rate this file! 13 Downloads (last 30 days) File Size: 3.34 KB File ID: #35052

rename_files_by_age

by

 

12 Feb 2012 (Updated )

Automatically rename files by age from a set date. I use it to date pictures and videos of my kid.

| Watch this File

File Information
Description

% 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

Required Products MATLAB
MATLAB release MATLAB 7.4 (R2007a)
Other requirements windows
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Updates
28 Feb 2012

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

12 Aug 2013

fixed an error and added mp4 video check.

Contact us