Ramnarayan
Programmer
Hi,
I have completely written the script to find the _it, _ft, _wt, _wa, _ua, _ba, _wk, _yc, _1g to _9g fields from the below list. Now these fields can appear only within a _t3 field which is given below. Hence, if a _t3 field contains atleast one of the (_it, _ft, _wt, _wa, _ua, _ba, _wk, yc, _1g to _9g), It should add 1 to $trans variable.
Here is the snippet of the code:
open (DTC, "<$toc") or fatal("Can't open $toc: $!");
while (my $line = <DTC>)
{
if ($line =~ m/^(_t3\s*.+\r?\n)$/)
{
$flag = 1;
}
else {$flag = 0;}
if ($line =~ m/^_(it|ft|wt|wa|ua|ba|wk|yc|[1-9]g)/ && $flag == 1)
{
++$trans;
}
}
close DTC;
print "Trans: $trans\n";
Here is the extract of the toc file. This has examples of _it and _wt
_t3 AP000024 00368075 AP990837 99A00100
_g1 Scientific Books
_ty BRV
_tw Reproduction artificielle de mineraux au XIXe siecle
_wt Reproduction artificielle de minéraux au XIXe siècle
_aw P. N. Tchirwinsky
_pg 66-68
_mf [Raw ASCII] 26 27 28
_mf [TIFF 6.0] 26 27 28
_t3 AP000024 00368075 AP990837 99A00110
_ti Miastor Larvae
_it Miastor Larvæ
_au E. P. Felt
_pg 583
_mf [Raw ASCII] 31
_mf [TIFF 6.0] 31
==================
Please note that each t3 may contain any of the (_it, _ft, _wt, _wa, _ua, _ba, _wk, yc, _1g to _9g). Either of these fields can occur anywhere within a _t3 block.
Can someone help me out. I will be very grateful to whoever can help me here!
Thanks
I have completely written the script to find the _it, _ft, _wt, _wa, _ua, _ba, _wk, _yc, _1g to _9g fields from the below list. Now these fields can appear only within a _t3 field which is given below. Hence, if a _t3 field contains atleast one of the (_it, _ft, _wt, _wa, _ua, _ba, _wk, yc, _1g to _9g), It should add 1 to $trans variable.
Here is the snippet of the code:
open (DTC, "<$toc") or fatal("Can't open $toc: $!");
while (my $line = <DTC>)
{
if ($line =~ m/^(_t3\s*.+\r?\n)$/)
{
$flag = 1;
}
else {$flag = 0;}
if ($line =~ m/^_(it|ft|wt|wa|ua|ba|wk|yc|[1-9]g)/ && $flag == 1)
{
++$trans;
}
}
close DTC;
print "Trans: $trans\n";
Here is the extract of the toc file. This has examples of _it and _wt
_t3 AP000024 00368075 AP990837 99A00100
_g1 Scientific Books
_ty BRV
_tw Reproduction artificielle de mineraux au XIXe siecle
_wt Reproduction artificielle de minéraux au XIXe siècle
_aw P. N. Tchirwinsky
_pg 66-68
_mf [Raw ASCII] 26 27 28
_mf [TIFF 6.0] 26 27 28
_t3 AP000024 00368075 AP990837 99A00110
_ti Miastor Larvae
_it Miastor Larvæ
_au E. P. Felt
_pg 583
_mf [Raw ASCII] 31
_mf [TIFF 6.0] 31
==================
Please note that each t3 may contain any of the (_it, _ft, _wt, _wa, _ua, _ba, _wk, yc, _1g to _9g). Either of these fields can occur anywhere within a _t3 block.
Can someone help me out. I will be very grateful to whoever can help me here!
Thanks