open(IN, '<', $file) or die "Couldn't open $file for reading: $!\n\n"; my (@hdr, %stn, %seg); my ($lname); while () { if (/^H/ ... /[<\[]/) ## If it's a header line... { push(@hdr, $_); ## ...add it to @hdr next; } next if (/reclin/i); ## If it's a DISCO header, ignore; continue to ## next iteration ## Not a header, so must be data.... ( $lname = substr($_,1,16) ) =~ s/\s+//g; ( my $s = substr($_,17,8) ) =~ s/\s+//g; ( my $x = substr($_,45,8) ) =~ s/\s+//g; ( my $y = substr($_,53,8) ) =~ s/\s+//g; ( my $z = substr($_,61,5) ) =~ s/\s+//g; $stn{$s} = [ $x, $y, $z ]; ## HoA: Keys = Stn ID ## Value = Stn Coords