Change LensType only for some files

Started by bruceas, March 18, 2014, 06:18:59 AM

Previous topic - Next topic

bruceas

HI, I must change ONLY files with "Lens ID" = "Sigma 18-250mm F3.5-6.3 DC OS HSM" to LensType=50.
All other files must be unchanged.

How i can do it?

Original file:
Lens Type                       : Tamron or Sigma Lens (128)
Lens Spec                       : 18-250mm F3.5-6.3
Lens Mount                      : A-Mount
Lens Format                     : Full-frame
Lens Info                       : 18-250mm f/3.5-6.3
Lens Model                      : 18-250mm F3.5-6.3
Lens ID                         : Sigma 18-250mm F3.5-6.3 DC OS HSM

Original file -n:
Lens Type                       : 128
Lens Spec                       : 00 18 250 3.5 6.3 00
Lens Mount                      : 1
Lens Format                     : 2
Lens Info                       : 18 250 3.5 6.3
Lens Model                      : 18-250mm F3.5-6.3
Lens ID                         : 128

************************
Desidered file:
Lens Type                       : Sony DT 18-250mm F3.5-6.3 (SAL18250)
Lens Spec                       : 18-250mm F3.5-6.3
Lens Mount                      : A-Mount
Lens Format                     : Full-frame
Lens Info                       : 18-250mm f/3.5-6.3
Lens Model                      : 18-250mm F3.5-6.3
Lens ID                         : Sony DT 18-250mm F3.5-6.3 (SAL18250)

Desidered file -n:
Lens Type                       : 50
Lens Spec                       : 00 18 250 3.5 6.3 00
Lens Mount                      : 1
Lens Format                     : 2
Lens Info                       : 18 250 3.5 6.3
Lens Model                      : 18-250mm F3.5-6.3
Lens ID                         : 50


Thanks, bye.






Phil Harvey

exiftool -lenstype#=50 -if '$lensid eq "Sigma 18-250mm F3.5-6.3 DC OS HSM"' DIR

where DIR is the name of the directory containing the images

(the above quoting is for Mac/Linux.  Swap the single for double quotes if you are on Windows)

- 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 ($).

bruceas

Quote from: Phil Harvey on March 18, 2014, 06:29:18 AM
exiftool -lenstype#=50 -if '$lensid eq "Sigma 18-250mm F3.5-6.3 DC OS HSM"' DIR

where DIR is the name of the directory containing the images

(the above quoting is for Mac/Linux.  Swap the single for double quotes if you are on Windows)
I am on Windows and the directory is the current directory, so i must write?:

exiftool -lenstype#=50 -if "$lensid eq "Sigma 18-250mm F3.5-6.3 DC OS HSM""

The output is :
File not found: 18-250mm
File not found: F3.5-6.3
File not found: DC
File not found: OS
File not found: HSM
    0 image files read
    5 files could not be read

Thanks.

StarGeek

exiftool -lenstype#=50 -if "$lensid eq 'Sigma 18-250mm F3.5-6.3 DC OS HSM'" DIR
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

bruceas