ExifTool Forum

ExifTool => Newbies => Topic started by: dijkstra on January 27, 2013, 07:52:46 AM

Title: remove a line in a caption
Post by: dijkstra on January 27, 2013, 07:52:46 AM
Is it possible to remove a line in a caption ? I inhereted a digital photoarchive from a passed away collegue and I have to remove the copyrightline that he did place in the caption in about 40.000 pictures. The rest of the caption must stay intact.
Thanks for your help
Title: Re: remove a line in a caption
Post by: Phil Harvey on January 27, 2013, 01:56:22 PM
This is easy using the very-soon-to-be-released ExifTool 9.15, like this:

exiftool "-caption-abstract<${caption-abstract;s/Copyright.*//}" FILE

(The quoting above is for windows, and I am assuming that you want to edit the Caption-Abstract tag and that the copyright  line starts with the word "Copyright".)

- Phil
Title: Re: remove a line in a caption
Post by: Phil Harvey on January 27, 2013, 03:17:19 PM
ExifTool 9.15 is now available.

A problem with the command I gave above is that it will leave the newline character.  I think this may remove it too:

exiftool "-caption-abstract<${caption-abstract;s/Copyright.*\\n//}" FILE

but I can't test this.  The only question is how to escape the backslash on the Windows command line, but I think the double backslash should do it.

- Phil
Title: Re: remove a line in a caption
Post by: StarGeek on January 27, 2013, 04:40:00 PM
Quote from: Phil Harvey on January 27, 2013, 01:56:22 PM
This is easy using the very-soon-to-be-released ExifTool 9.15, like this:

exiftool "-caption-abstract<${caption-abstract;s/Copyright.*//}" FILE

Thank you so very much for this!!  I'll certainly be giving it a workout.
Title: Re: remove a line in a caption
Post by: StarGeek on January 27, 2013, 05:19:18 PM
Quote from: Phil Harvey on January 27, 2013, 03:17:19 PM
but I can't test this.  The only question is how to escape the backslash on the Windows command line, but I think the double backslash should do it.

Single backslash seems to work fine.  I tested
ExifTool "-caption-abstract<${caption-abstract;s/\n/\r\n/g}" Test.jpg

And it replaced all LFs with CR+LF.
Title: Re: remove a line in a caption
Post by: dijkstra on January 28, 2013, 05:14:59 PM
GREAT ;-)
I will try that tomorrow

thanx
roel