Permalink
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
inc-meta/utilities/2016-09-16/doall.pl
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves ukf/ukf-meta#111.
executable file
28 lines (25 sloc)
806 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use warnings; | |
open(F, "id-to-name.txt") || die "could not open id-to-name map"; | |
while (<F>) { | |
my ($orgid, $name) = split /[\t\n]/; | |
# print "name='$name' --> orgid='$orgid'\n"; | |
$name_to_orgid{$name} = $orgid; | |
} | |
close(F); | |
open(F, "ukid-to-name.txt") || die "could not open ukid-to-name map"; | |
while (<F>) { | |
my ($ukid, $name) = split /[\t\n]/; | |
# print "ukid='$ukid' --> name='$name'\n"; | |
if (defined $name_to_orgid{$name}) { | |
# print " --> orgid='$name_to_orgid{$name}'\n" | |
my $orgid = $name_to_orgid{$name}; | |
$command = "perl -i patch.pl $orgid entities/$ukid.xml"; | |
print "$ukid --> $orgid $command\n"; | |
system($command); | |
} else { | |
die "'$name' unmapped"; | |
# print " --> undefined\n"; | |
} | |
} | |
close(F); |