Del all but date/time

Started by Inge, April 16, 2020, 08:48:00 AM

Previous topic - Next topic

Inge

Hello,
please excuse my bad english!
I have a folder with lot's of jpg and would like to delete all but date and time.
Me thought this would be correct?

exiftool "-all= --alldates" *.jpg

But all it does is writing "--alldates" in the Manufacturer, Modell and Software line; other lines are untouched.

Please help! Thanks a lot!

Phil Harvey

From the exiftool application documentation (emphasis added):

      --TAG
            Exclude specified tag from extracted information.  Same as the -x
            option.  Group names and wildcards are permitted as described
            above for -TAG.  Once excluded from the output, a tag may not be
            re-included by a subsequent option.  May also be used following a
            -tagsFromFile option to exclude tags from being copied (when
            redirecting to another tag, it is the source tag that should be
            excluded), or to exclude groups from being deleted when deleting
            all information (eg. "-all= --exif:all" deletes all but EXIF
            information).  But note that this will not exclude individual tags
            from a group delete
(unless a family 2 group is specified, see
            note 4 below).  Instead, individual tags may be recovered using
            the -tagsFromFile option
(eg. "-all= -tagsfromfile @ -artist").


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

Inge

Thanks Phil, but I'm still confused.
So what I did:

1. Copying date info to a text file:

exiftool -alldates out.txt *.jpg

2. Deleted all data:

exiftool -all= *.jpg

3. Tried to copy date back from saved file:

exiftool -tagsfromfile out.txt -alldates *.jpg

Result: Warning: No writable tags set from out.txt
    0 image files updated
   35 image files unchanged


I guess I'm lost? THX!

StarGeek

Try this
exiftool -all= -TagsFromFile @ -AllDates <FileOrDir>

This removes all the data then copies AllDates back into the file.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Inge

Thank you StarGeek! You saved my life! ;-)