CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [Zhris] Parsing data from TXT file into XMP format with ExifTool: Edit Log



teddoff
Novice

May 15, 2015, 5:58 PM


Views: 16323
Re: [Zhris] Parsing data from TXT file into XMP format with ExifTool

Thank you again for your efforts. As I interpret from your code "my $filepath = '/path/to/file.txt';" points to a specific file. Mentioned at the end of your post was my workflow, I am on OS X and the files I get are paired with TXT files, so a file called "abc.gif" (of which that format cannot store IPTC metadata) is accompanied by a text file with the name "abc.gif.txt" which makes it really easy to associate the metadata with the correlating image file.

Typically I'll have a folder of 20 or so files, so 40 then, and wanted to just type a command into Terminal (OS X) and then have ExifTool spit out XMP files with the data contained in the TXT file reorganised so when I import the image files (renamed as e.g. "abc.gif.xmp") the data will simply import at the same time.

It's a unique situation I know, not many people are going to be in this situation, but that's my present workflow.



Code
$exifTool->SetNewValue(Author => $hash{Title});   
$exifTool->WriteInfo('image.jpg','modified_image.jpg'); # 3rd arg should be 'XMP' if you want to create an XMP data file.


I think that your code might apply this one example I have given to many files, rather than to interpret each file differently, although I can't be sure?

I have a link to a small group of samples you will see what I mean, workflow wise: http://cl.ly/2c1I0I432B03

I was confused about the command you offered: "perl script.pl /path/to/dir/*" as I thought the code was for the ARGV file and not a perl script, even though this is a perl forum. Why would the ARGV file contain file paths, surely I could point at a directory and just have it convert everything in there.

Apologies if I am confusing the situation further.


(This post was edited by teddoff on May 15, 2015, 6:01 PM)


Edit Log:
Post edited by teddoff (Novice) on May 15, 2015, 6:00 PM
Post edited by teddoff (Novice) on May 15, 2015, 6:01 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives