Talk:ImportCustomFieldValues/@comment-Missbook-20121130205417
Thank you! This worked nicely for me! I changed it for CustomFields with a Category (though I am not the best at perl)
Adding variables at the top:
my @newValue;
my $entry;
my $cat;
And a new foreach loop:
foreach my $line (@lines) {
@newValue = split(/,/, $line);
$entry = $newValue[1];
$cat = $newValue[0];
unless ( grep { $entry eq $_ } @current ) {
print STDERR "Adding " . $entry . " with category " . $cat . "\n" if ($args{'verbose'});
my ( $ret, $val ) = $cf->AddValue( Name => $entry, Category => $cat );
}
}