forked from hmw3/Tips_and_Hacks
Adding needed files
This commit is contained in:
parent
a4e739988b
commit
feefe56297
|
@ -0,0 +1,59 @@
|
|||
# Step 1 in updating OSHB to MAST_HB
|
||||
# Converts file names and internal verse refs to WA MAST abbreviations
|
||||
# After this need to run Convert_refs_in_MAST_HB.pl to get data in file to conform
|
||||
|
||||
while (<DATA>) {
|
||||
if (/([^\t]*)\t([^\t]*)/) {
|
||||
#($oldName, $newName) = ($1, $2);
|
||||
$new_name{$1} = $2
|
||||
}
|
||||
}
|
||||
|
||||
chdir "/Users/Henry/Documents/git.Door43/MAST_HB";
|
||||
|
||||
foreach $old_name (sort keys %new_name) {
|
||||
system "mv $old_name $new_name{$old_name}"
|
||||
}
|
||||
|
||||
print "Done.\n"
|
||||
|
||||
__DATA__
|
||||
Gen.xml 01-GEN.xml
|
||||
Exod.xml 02-EXO.xml
|
||||
Lev.xml 03-LEV.xml
|
||||
Num.xml 04-NUM.xml
|
||||
Deut.xml 05-DEU.xml
|
||||
Josh.xml 06-JOS.xml
|
||||
Judg.xml 07-JDG.xml
|
||||
Ruth.xml 08-RUT.xml
|
||||
1Sam.xml 09-1SA.xml
|
||||
2Sam.xml 10-2SA.xml
|
||||
1Kgs.xml 11-1KI.xml
|
||||
2Kgs.xml 12-2KI.xml
|
||||
1Chr.xml 13-1CH.xml
|
||||
2Chr.xml 14-2CH.xml
|
||||
Ezra.xml 15-EZR.xml
|
||||
Neh.xml 16-NEH.xml
|
||||
Esth.xml 17-EST.xml
|
||||
Job.xml 18-JOB.xml
|
||||
Ps.xml 19-PSA.xml
|
||||
Prov.xml 20-PRO.xml
|
||||
Eccl.xml 21-ECC.xml
|
||||
Song.xml 22-SNG.xml
|
||||
Isa.xml 23-ISA.xml
|
||||
Jer.xml 24-JER.xml
|
||||
Lam.xml 25-LAM.xml
|
||||
Ezek.xml 26-EZK.xml
|
||||
Dan.xml 27-DAN.xml
|
||||
Hos.xml 28-HOS.xml
|
||||
Joel.xml 29-JOL.xml
|
||||
Amos.xml 30-AMO.xml
|
||||
Obad.xml 31-OBA.xml
|
||||
Jonah.xml 32-JON.xml
|
||||
Mic.xml 33-MIC.xml
|
||||
Nah.xml 34-NAM.xml
|
||||
Hab.xml 35-HAB.xml
|
||||
Zeph.xml 36-ZEP.xml
|
||||
Hag.xml 37-HAG.xml
|
||||
Zech.xml 38-ZEC.xml
|
||||
Mal.xml 39-MAL.xml
|
|
@ -0,0 +1,78 @@
|
|||
# Converts internal verse refs to WA MAST abbreviations
|
||||
use 5.12.0;
|
||||
use File::Slurp;
|
||||
use File::Find ;
|
||||
use Cwd ;
|
||||
use utf8;
|
||||
#use open IN => ":utf8", OUT => ":utf8";
|
||||
use open IO => ":utf8";
|
||||
|
||||
my ($oldName, $newName);
|
||||
my $topDir = "/Users/Henry/Documents/git.Door43/MAST_HB";
|
||||
my (%new_name);
|
||||
|
||||
while (<DATA>) {
|
||||
chomp;
|
||||
if (/([^\t]*)\t([^\t]*)/) {
|
||||
($oldName, $newName) = ($1, lc $2);
|
||||
$new_name{$1} = lc $2
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my @filesToRun = ();
|
||||
my $filePattern = '*.xml' ;
|
||||
find( sub { push @filesToRun, $File::Find::name if ( m/^(.*)$filePattern$/ ) }, $topDir) ;
|
||||
|
||||
foreach my $file ( @filesToRun ) {
|
||||
say $file;
|
||||
my $fileText = read_file("$file", binmode => 'utf8');
|
||||
foreach my $key (sort keys %new_name) {
|
||||
$fileText =~ s/(osisID=")$key(\.\d+\.\d+")/$1$new_name{$key}$2/g;
|
||||
}
|
||||
open(OUT, ">:utf8", "$file") or die "$file:\n$!";
|
||||
say OUT $fileText;
|
||||
close OUT;
|
||||
}
|
||||
print "Done.\n"
|
||||
|
||||
__DATA__
|
||||
Gen GEN
|
||||
Exod EXO
|
||||
Lev LEV
|
||||
Num NUM
|
||||
Deut DEU
|
||||
Josh JOS
|
||||
Judg JDG
|
||||
Ruth RUT
|
||||
1Sam 1SA
|
||||
2Sam 2SA
|
||||
1Kgs 1KI
|
||||
2Kgs 2KI
|
||||
1Chr 1CH
|
||||
2Chr 2CH
|
||||
Ezra EZR
|
||||
Neh NEH
|
||||
Esth EST
|
||||
Job JOB
|
||||
Ps PSA
|
||||
Prov PRO
|
||||
Eccl ECC
|
||||
Song SNG
|
||||
Isa ISA
|
||||
Jer JER
|
||||
Lam LAM
|
||||
Ezek EZK
|
||||
Dan DAN
|
||||
Hos HOS
|
||||
Joel JOL
|
||||
Amos AMO
|
||||
Obad OBA
|
||||
Jonah JON
|
||||
Mic MIC
|
||||
Nah NAM
|
||||
Hab HAB
|
||||
Zeph ZEP
|
||||
Hag HAG
|
||||
Zech ZEC
|
||||
Mal MAL
|
|
@ -0,0 +1,43 @@
|
|||
Do_it () {
|
||||
echo
|
||||
echo "pushing Files for Update"
|
||||
(cd "/home/henry/Documents/WA_Repo/Tips_and_Hacks/MAST_tW_PDF_Updater/FilesForUpdates";
|
||||
git pull
|
||||
git commit -a -m "$answer"
|
||||
git push) || { echo 'Could not commit!' >&2; exit 1; }
|
||||
echo
|
||||
echo "pushing ULB"
|
||||
(cd "/home/henry/Documents/WA_Repo/en_ulb";
|
||||
git pull
|
||||
git commit -a -m "$answer"
|
||||
git push) || { echo 'Could not commit!' >&2; exit 1; }
|
||||
echo
|
||||
echo "pushing UDB"
|
||||
(cd "/home/henry/Documents/WA_Repo/en_udb";
|
||||
git pull
|
||||
git commit -a -m "$answer"
|
||||
git push) || { echo 'Could not commit!' >&2; exit 1; }
|
||||
echo
|
||||
echo "pushing tW"
|
||||
(cd "/home/henry/Documents/WA_Repo/en_tw";
|
||||
git pull
|
||||
git commit -a -m "$answer"
|
||||
git push) || { echo 'Could not commit!' >&2; exit 1; }
|
||||
echo
|
||||
echo "pushing tN"
|
||||
(cd "/home/henry/Documents/WA_Repo/en_tn";
|
||||
git pull
|
||||
git commit -a -m "$answer"
|
||||
git push) || { echo 'Could not commit!' >&2; exit 1; }
|
||||
}
|
||||
|
||||
echo
|
||||
answer=$1
|
||||
if [ -z "$answer" ]
|
||||
then
|
||||
echo "Commit message needed"
|
||||
else
|
||||
echo "Commit message is $answer"
|
||||
Do_it
|
||||
fi
|
||||
echo
|
|
@ -0,0 +1,44 @@
|
|||
Do_it () {
|
||||
echo
|
||||
echo "pushing ULB"
|
||||
(cd "/Users/Henry/Documents/git.Door43/en_ulb";
|
||||
git pull
|
||||
git commit -a -m "$answer"
|
||||
git push) || { echo 'Could not commit!' >&2; exit 1; }
|
||||
echo
|
||||
echo "pushing UDB"
|
||||
(cd "/Users/Henry/Documents/git.Door43/en_udb";
|
||||
git pull
|
||||
git commit -a -m "$answer"
|
||||
git push) || { echo 'Could not commit!' >&2; exit 1; }
|
||||
echo
|
||||
echo "pushing tW"
|
||||
(cd "/Users/Henry/Documents/git.Door43/en_tw";
|
||||
git pull
|
||||
git commit -a -m "$answer"
|
||||
git push) || { echo 'Could not commit!' >&2; exit 1; }
|
||||
echo
|
||||
echo "pushing tN"
|
||||
(cd "/Users/Henry/Documents/git.Door43/en_tn";
|
||||
git pull
|
||||
git commit -a -m "$answer"
|
||||
git push) || { echo 'Could not commit!' >&2; exit 1; }
|
||||
echo
|
||||
echo "pushing Files for Update"
|
||||
(cd "/Users/Henry/Documents/git.Door43/Tips_and_Hacks/MAST_tW_PDF_Updater/FilesForUpdates";
|
||||
git pull
|
||||
git commit -a -m "$answer"
|
||||
git push) || { echo 'Could not commit!' >&2; exit 1; }
|
||||
}
|
||||
|
||||
echo
|
||||
answer=$1
|
||||
if [ -z "$answer" ]
|
||||
then
|
||||
echo "Commit message needed"
|
||||
else
|
||||
echo "Commit message is $answer"
|
||||
Do_it
|
||||
fi
|
||||
echo
|
||||
echo
|
Loading…
Reference in New Issue