My file is on another computer and this file contains over 17000 seismic events recorded from stations. This is what an event would look like in my file.
The first line is year, month, day, the origin of the quake in hrs, min., sec., the lat., long, depth, magnitude at 3 different places, the no of stations recording the event, the azimuthal gap, dmin, rms, erh, erz, quality, source, other mags, location/ comments. This would look like this in the file;
10 11 01 1127 47.7 44.798 111.367 9.4 .8 2.2 0.0 19 91 0.10 0.4 0.5 b MBMG 0.0 0.0 0.0 7.7 km SSW of Hebgen Dam
that would be the first line. The other lines contain the actual event data. I want to pick pieces of data from each of these columns of data and sort it into a format for a new file to be run through another program. I don't know how to declare variables when the information is in columns. How do I call the value for the number of stations from that line of code.
| [reply] [d/l] |
split the line on whitespace and store the results in an array. If the number of stations is the 5th token on the line, access it like this:
my @tokens = split;
my $num_st = $tokens[4];
| [reply] [d/l] |