Pity you aren't going the other way (copying information
from files in a
single directory to files in a hierarchy), because you could
do that with:<br /><br />
<code> exiftool -r -tagsfromfile d:\dirx\%f.jpg
-ext jpg c:\
</code><br />
but that won't work for what you want to do.<br
/><br />
In your case you will have to use a script to automate what
you want to do.
Using the following command:<br /><br />
<code> script_name C:\ D:\dirx
</code><br />
This perl script should do what you want:<br /><br
/>
<code>#!/usr/bin/perl -w
use strict;
my $src = shift;
my $dst = shift || die "Must specify source and
destination directory\n";
opendir(DIR, $src) or die "Error opening directory
$src\n";
my files = readdir(DIR);
closedir(DIR);
-d $dst or die "$dst is not a directory\n";
my ($file, $jpg);
foreach $file ( files) {
next if $file =~ /^\./ or not -d
"$src/$file";
print "==== Directory $src/$file:\n";
opendir(DIR, "$src/$file") or die
"Error opening $src/$file\n";
my jpgs = readdir(DIR);
closedir(DIR);
foreach $jpg ( jpgs) {
next unless $jpg =~ /\.jpg/i;
my $srcname = "$src/$file/$jpg";
my $dstname = "$dst/$jpg";
print "---- Source file: $srcname\n";
-e $dstname or warn("Warning: $dstname
doesn't exist\n"), next;
print `exiftool -tagsfromfile "$srcname"
"$dstname"`;
}
}
# end
</code>
To write a respons, access
http://ww
w.cpanforum.com/response_form/1846
To see the full thread, access
http://www.cpan
forum.com/threads/1749
--
You are getting this messages from www.cpanforum.com
To change your subscription information visit http://www.cpanforum.
com/mypan/
|