Author Topic: Move to Directory  (Read 3948 times)

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14438
    • ExifTool Home Page
Re: Move to Directory
« Reply #15 on: April 19, 2016, 03:39:51 PM »
OK then.  I may be able to figure out what is happening if you post the output of this command for some of the files that are getting sorted incorrectly:

exiftool -datetimeoriginal -r D:\OneDrive\Pictures\Sorted

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

47u2caryj

  • Jr. Member
  • **
  • Posts: 10
Re: Move to Directory
« Reply #16 on: April 19, 2016, 04:02:50 PM »
This is my mobile pc so the D:\ directory is C:\ but I think you will get the point.

======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/1990s/2004/04-Apr/2004_04_22-13_38_45_000-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2004:04:22 13:38:45
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2011/07-Jul/2011_07_29-09_20_24_150-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2011:07:29 09:20:24
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2011/07-Jul/2011_07_29-09_20_26_650-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2011:07:29 09:20:26
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2011/07-Jul/2011_07_29-09_20_33_540-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2011:07:29 09:20:33
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2011/07-Jul/2011_07_29-09_20_35_480-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2011:07:29 09:20:35
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2011/07-Jul/2011_07_29-09_20_48_210-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2011:07:29 09:20:48
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2011/07-Jul/2011_07_29-09_21_21_820-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2011:07:29 09:21:21
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2011/07-Jul/2011_07_29-09_21_24_230-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2011:07:29 09:21:24
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2012/07-Jul/2012_07_03-18_48_57_000-United States_Wisconsin_Van Dyne.JPG
Date/Time Original              : 2012:07:03 18:48:57
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2012/07-Jul/2012_07_27-08_57_18_000-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2012:07:27 08:57:18
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2012/07-Jul/2012_07_27-08_57_19_410-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2012:07:27 08:57:19
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2012/07-Jul/2012_07_27-08_57_24_400-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2012:07:27 08:57:24
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2012/07-Jul/2012_07_27-08_57_28_410-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2012:07:27 08:57:28
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2012/07-Jul/2012_07_27-08_57_39_160-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2012:07:27 08:57:39
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2012/07-Jul/2012_07_27-08_57_41_150-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2012:07:27 08:57:41
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2012/07-Jul/2012_07_27-08_57_43_000-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2012:07:27 08:57:43
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2012/07-Jul/2012_07_27-08_57_49_160-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2012:07:27 08:57:49
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2012/07-Jul/2012_07_27-08_57_50_490-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2012:07:27 08:57:50
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2012/10-Oct/2012_10_20-22_53_15_000-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2012:10:20 22:53:15
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2012/10-Oct/2012_10_20-22_53_15_000-United States_Wisconsin_Milwaukee_2.JPG
Date/Time Original              : 2012:10:20 22:53:15
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2013/10-Oct/2013_10_19-19_08_37_000-United States_New Mexico_Albuquerque.jpg
Date/Time Original              : 2013:10:19 19:08:37
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/02-Feb/2014_02_16-17_27_03_263-United States_Wisconsin_Milwaukee.JPG
Date/Time Original              : 2014:02:16 17:27:03
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/03-Mar/2014_03_12-20_02_47_472-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2014:03:12 20:02:47
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/03-Mar/2014_03_13-21_26_50_261-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2014:03:13 21:26:50
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/03-Mar/2014_03_14-22_49_08_031-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2014:03:14 22:49:08
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/03-Mar/2014_03_14-22_49_16_739-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2014:03:14 22:49:16
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/03-Mar/2014_03_14-22_49_37_091-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2014:03:14 22:49:37
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/03-Mar/2014_03_16-11_04_12_431-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2014:03:16 11:04:12
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/03-Mar/2014_03_16-11_04_19_278-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2014:03:16 11:04:19
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/03-Mar/2014_03_16-20_10_35_177-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2014:03:16 20:10:35
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/03-Mar/2014_03_16-20_10_36_197-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2014:03:16 20:10:36
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/03-Mar/2014_03_17-17_10_26_710-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2014:03:17 17:10:26
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/03-Mar/2014_03_17-20_20_37_837-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2014:03:17 20:20:37
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/03-Mar/2014_03_17-20_20_49_242-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2014:03:17 20:20:49
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2014/03-Mar/2014_03_17-21_02_50_533-United States_Wisconsin_Milwaukee.jpg
Date/Time Original              : 2014:03:17 21:02:50
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2016/03-Mar/artist.jpg
Date/Time Original              : 2016:03:07 14:53:25
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2016/03-Mar/noartist.jpg
Date/Time Original              : 2016:03:07 14:53:25
======== C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/2000s/2016/04-Apr/20160408_121814903_iOS.jpg
Date/Time Original              : 2016:04:08 07:18:14
   18 directories scanned
   38 image files read

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14438
    • ExifTool Home Page
Re: Move to Directory
« Reply #17 on: April 19, 2016, 04:19:38 PM »
What happens if you run your command only on the first file?:

C:/Users/johnm/OneDrive/Pictures/Camera Roll/sorting_incorrectly/1990s/2004/04-Apr/2004_04_22-13_38_45_000-United States_Wisconsin_Milwaukee.jpg

I ran your command on a file with this exact DateTimeOriginal and it sorted the file properly into 2000s/2004/04-Apr.

Wait.  I could see the problem happening if there are same-named files already in the output directory.  If this happens, then the move will fail and it will get moved into the next lower decade folder.  Are you looking at the warning messages? -- you should get an indication of this.  To avoid this you could add the test for the upper end of the date range.

- Phil
« Last Edit: April 19, 2016, 04:33:08 PM by Phil Harvey »
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).