http://esdynamics.geowissenschaften.uni-tuebingen.de/~esd/tutorials/perl/start.html
http://www.perl.com/pub/2008/04/23/a-beginners-introduction-to-perl-510.html
http://perldoc.perl.org/index-tutorials.html
#!/usr/bin/perl -w
foreach $fn (<*BHZ*.SAC>){
foreach (`sachdr -l $fn`){
if (/kstnm/){
@a=split;
$sta=$a[2];
}
if (/stla/){
@b=split;
$stla=$b[2];
}
if (/stlo/){
@c=split;
$stlo=$c[2];
}
}
print "$sta $stla $stlo\n";
};
No comments:
Post a Comment