|
Re: Datum Change
Here is a Perl script which raises all XS points by 2.2 feet. It should get you started even if you don't have Perl
expertise on hand.
# Raises or lowers all cross sections in a RAS geometry file
# by a fixed amount. Specify two command-line arguments: the existing
# geometry filename (input file) and a new filename (output file).
$delta = 2.2; # number of feet to raise
($IN,$OUT)=@ARGV;
open(IN) || die "$!";
open(OUT,">$OUT") || die "$!";
while($_=<IN>) {
if(/^#Sta/Elev=(.*)$/) {
print OUT;
$nOrds=$1;
for($i=0;$i<=int($nOrds/5);$i++) {
@points=split(/s+/,$_=<IN>);
foreach $sta (2,4,6,8,10) {
$points[$sta]+=$delta if $sta<=$#points;
}
for($ind=1;$ind<$#points;$ind+=2) {
printf OUT "%8.1f%8.1f", $points[$ind], $points[$ind+1];
}
printf OUT "
";
}
} else {
print OUT;
}
}
|