Sunday, January 25, 2015

XPS File Generator Perl

#!/usr/bin/perl
$SLNMIN=3142;
$SLNMAX=3518;
$SPNMIN=7187;
$SPNMAX=7778;
$noofSLN=377;
#$noofSPN=592;
$noofSPN=148; ##592/number of source per patch
$norec=200;  ### no of receiver per cable
$nocable=6;  ### no of cable per patch
$noshot=4;   ### no of source per patch

for $n (0..$noofSLN-1)
{
for $m (0..$noofSPN-1)
{
$SLN=$SLNMIN+$n;
$SPN=$SPNMIN+$m*$noshot;
$RD1=$SLN-99;
for $j (0..$noshot-1)
{
$SPNn=$SPN-12;
for $i (0..$nocable-1)
{
print  $SLN;
$SPNnew=$SPN+$j;
print  $SPNnew, "\t";
print  "1";
printf  "%4d",$i*$norec+1;
printf  "%4d",$i*$norec+$norec;
print  "1", "\t";
$SPNn=$SPNn+4;
print  $SPNn;
print  $RD1;
print  $SPNn;
print  $RD1+$norec-1, "\n";
}
}
}
}

No comments: