Author Topic: import iptc metadata from text-file  (Read 4858 times)

Offline suitbert

  • Newcomer
  • *
  • Posts: 4
    • View Profile
import iptc metadata from text-file
« on: July 21, 2016, 09:45:44 AM »
Hello,
as a PM Newbie I am searching for a how-to to get some metadata via batch to a large amount of photos.
The text-file is as follows:
img001.jpg caption1 headline1
img002.jpg caption2 headline2
img003.jpg caption3 headline3

Any idea where I can have a look at!? Thanks a lot!
regards,
Suitbert

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24756
    • View Profile
    • Camera Bits, Inc.
Re: import iptc metadata from text-file
« Reply #1 on: July 21, 2016, 10:14:56 AM »
Suitbert,

as a PM Newbie I am searching for a how-to to get some metadata via batch to a large amount of photos.
The text-file is as follows:
img001.jpg caption1 headline1
img002.jpg caption2 headline2
img003.jpg caption3 headline3

Photo Mechanic's "Code Replacement" feature is perfect for this.  You need to have your text file have 'tab characters' between each column of data in order for it to work with Code Replacement.  So your text file would look like this:

img001.jpg[tab]caption1[tab]headline1
img002.jpg[tab]caption2[tab]headline2
img003.jpg[tab]caption3[tab]headline3

Then you would add your file to the Code Replacement dialog.  (Edit->Settings->Set Code Replacements...)  Click the "Add..." button and choose your text file.

Then you will need to prepare an IPTC Stationery Pad.  (Image->IPTC Stationery Pad...)

In the Caption field you would enter:

\{filename}\

In the Headline field you would enter:

\{filename}#2\

This will cause the fields to be filled in with the values from your text file.  Click the "Close Stationery" button.  Open the folder containing your images and select them all.  Now you can apply your prepared IPTC Stationery Pad (Image->Apply IPTC Stationery Pad to Photos")

Your images should now all have their captions and headlines set.

http://wiki.camerabits.com/en/index.php?title=User_Manual_Flat_View#Code_Replacement
http://wiki.camerabits.com/en/index.php?title=User_Manual_Flat_View#IPTC_Stationery_Pad

Please let me know if you have any further questions.

-Kirk

Offline suitbert

  • Newcomer
  • *
  • Posts: 4
    • View Profile
Re: import iptc metadata from text-file
« Reply #2 on: July 21, 2016, 11:25:21 PM »
Hello Kirk,

thanks a lot for this instructions. Working all very good importing the metadata from the textfile.

Only one question left: I have imported some keywords (like: [tab]keyword1; keyword2; keyword3[tab]
These are imported and could be seen in the metadata info window im PM afterwards (keyword1; keyword2; keyword3).
But when I do check those entries in Photoshop, they are listed as: "keyword1; keyword2; keyword3"

Any idea, how to get rid of those "" ? Thanks alot.

regards,

Suitbert

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: import iptc metadata from text-file
« Reply #3 on: July 22, 2016, 02:43:13 AM »
Have you tried using a comma instead of a semicolon? My guess is that the keywords you entered are seen as one keyword and as there is a "special" character in the string (the semicolon), photoshop adds the quotes.
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline suitbert

  • Newcomer
  • *
  • Posts: 4
    • View Profile
Re: import iptc metadata from text-file
« Reply #4 on: July 22, 2016, 07:16:19 AM »
Hayo, that's a very goog hint. I have tested it: the quotes disapeared! Thanks a lot!

regards,

Suitbert

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24756
    • View Profile
    • Camera Bits, Inc.
Re: import iptc metadata from text-file
« Reply #5 on: July 22, 2016, 08:42:12 AM »
In the IPTC/XMP preferences in PM, you can choose which separator PM should expect for repeating fields like Keywords.  The choices are comma (,) or semi-colon (;).

If you prefer semi-colons in your import data, choose semi-colons as your separator.

HTH,

-Kirk

Offline suitbert

  • Newcomer
  • *
  • Posts: 4
    • View Profile
Re: import iptc metadata from text-file
« Reply #6 on: July 22, 2016, 09:15:10 AM »
hello Kirk,

ok, fine, now I have found the correct setting  ;)
Thanks for your help!

regards,

Suitbert