diff --git a/MAST_tW_PDF_Updater/FilesForUpdates/tWs.from.MAST_HB.3.pl b/MAST_tW_PDF_Updater/FilesForUpdates/tWs.from.MAST_HB.pl similarity index 95% rename from MAST_tW_PDF_Updater/FilesForUpdates/tWs.from.MAST_HB.3.pl rename to MAST_tW_PDF_Updater/FilesForUpdates/tWs.from.MAST_HB.pl index 98b3544..bc22209 100644 --- a/MAST_tW_PDF_Updater/FilesForUpdates/tWs.from.MAST_HB.3.pl +++ b/MAST_tW_PDF_Updater/FilesForUpdates/tWs.from.MAST_HB.pl @@ -342,6 +342,7 @@ sub LinkSNsToULBtextViaEntries { say LOG "1\t\$SNsInCV{$thisCV}:$SNsInCV{$thisCV}"; #while ($SNsInCV{$thisCV} =~ s/(\[[^\]]*?) ([^\]]*?\] )/$1√$2/) {}; $SNsInCV{$thisCV} =~ s/√{2,}/√/g; + $SNsInCV{$thisCV} =~ s/^√+//g; say LOG "2\t\$SNsInCV{$thisCV}:$SNsInCV{$thisCV}"; my @regArray = split /√/, $SNsInCV{$thisCV}; say LOG "\@regArray: >@regArray<"; @@ -424,7 +425,7 @@ sub Adjust { my (%tempEntries); #say LOG ">\t\$sns: |$sns|"; #say LOG ">\t\$specifiedText{$ref}: |$specifiedText{$ref}|"; - $snsOld =~ s/^ +/ /; + $snsOld =~ s/^[√ ]+/ /; my @oldArray = split / /, $snsOld; #say LOG "\$adjust{$ref}: $adjust{$ref}"; my @preadjustments = split /, /, $adjust{$ref}; @@ -573,11 +574,25 @@ sub ProperOrderOutString { my ($ulb, $fileLoc) = ($2, $3); $ulb =~ s/ \.\.\. /.*?/g; say LOG "\t>>\t\$ulb: $ulb, \$fileLoc: $fileLoc, \$fullText{$thisCV}\n$fullText{$thisCV}"; - if ($fullText{$thisCV} =~ /^(.*?)\b($ulb)\b(.*)$/) { - say LOG "\t>>>\t$&"; - my ($order) = (length $1); - $orderedSet{$order} = $thisSet; - say LOG "\$order: $order\t \$orderedSet{$order}: $orderedSet{$order}" + if ($ulb =~ /^(.*)\.\.\.(.*)$/) { + my ($found1, $found2, $blank1, $blank2) = ($1, $2, "", ""); + while (length $blank1 < length $found1) {$blank1 .= " "} + while (length $blank2 < length $found2) {$blank2 .= " "} + if ($fullText{$thisCV} =~ s/^(.*?)\b$found1\b(.*)\b$found1\b(.*)$/$1$blank1$2$blank2$3/) { + say LOG "\t>>>\t$fullText{$thisCV}"; + my ($order) = (length $1); + $orderedSet{$order} = $thisSet; + say LOG "\t\t\t\$order: $order\t \$orderedSet{$order}: $orderedSet{$order}" + } + } else { + my $blank = ""; + while (length $blank < length $ulb) {$blank .= " "} + if ($fullText{$thisCV} =~ s/^(.*?)\b$ulb\b(.*)$/$1$blank$2/) { + say LOG "\t>>>>\t$fullText{$thisCV}"; + my ($order) = (length $1); + $orderedSet{$order} = $thisSet; + say LOG "\$order: $order\t \$orderedSet{$order}: $orderedSet{$order}" + } } } } diff --git a/MAST_tW_PDF_Updater/FilesForUpdates/tWs.from.MAST_NT.1.pl b/MAST_tW_PDF_Updater/FilesForUpdates/tWs.from.MAST_NT.pl similarity index 95% rename from MAST_tW_PDF_Updater/FilesForUpdates/tWs.from.MAST_NT.1.pl rename to MAST_tW_PDF_Updater/FilesForUpdates/tWs.from.MAST_NT.pl index 48c7540..37836b6 100644 --- a/MAST_tW_PDF_Updater/FilesForUpdates/tWs.from.MAST_NT.1.pl +++ b/MAST_tW_PDF_Updater/FilesForUpdates/tWs.from.MAST_NT.pl @@ -546,10 +546,25 @@ sub ProperOrderOutString { my ($ulb, $fileLoc) = ($2, $3); $ulb =~ s/ \.\.\. /.*?/g; say LOG "\t>>\t\$ulb: $ulb, \$fileLoc: $fileLoc, \$fullText{$thisCV}\n$fullText{$thisCV}"; - if ($fullText{$thisCV} =~ /^(.*?)\b($ulb)\b(.*)$/) { - say LOG "\t>>>\t$&"; - my ($order) = (length $1); - $orderedSet{$order} = $thisSet; + if ($ulb =~ /^(.*)\.\.\.(.*)$/) { + my ($found1, $found2, $blank1, $blank2) = ($1, $2, "", ""); + while (length $blank1 < length $found1) {$blank1 .= " "} + while (length $blank2 < length $found2) {$blank2 .= " "} + if ($fullText{$thisCV} =~ s/^(.*?)\b$found1\b(.*)\b$found1\b(.*)$/$1$blank1$2$blank2$3/) { + say LOG "\t>>>\t$fullText{$thisCV}"; + my ($order) = (length $1); + $orderedSet{$order} = $thisSet; + say LOG "\t\t\t\$order: $order\t \$orderedSet{$order}: $orderedSet{$order}" + } + } else { + my $blank = ""; + while (length $blank < length $ulb) {$blank .= " "} + if ($fullText{$thisCV} =~ s/^(.*?)\b$ulb\b(.*)$/$1$blank$2/) { + say LOG "\t>>>>\t$fullText{$thisCV}"; + my ($order) = (length $1); + $orderedSet{$order} = $thisSet; + say LOG "\$order: $order\t \$orderedSet{$order}: $orderedSet{$order}" + } } } }