It's been 2 years since I've done any work with regex in Perl so I'm hoping someone can offer a suggestion. I'd like to save all values in a text file (that's stored in array) between two keywords: "LON" and "TIME", into variables. The problem is I'd like to save each value to its own variable.
For example, in the file I might have something like: "LAT...LON 4435 9351 4821 9238 TIME" and I'd like to have $lat1 = 4435, $lon1 = 9351, $lat2 = 4821, $lon2 = 9238, etc.
Can anyone offer any help on how I could construct this regex? It is all being read from a file called file.txt as follows:
open(FILEHANDLE, "file.txt");
@text = <FILEHANDLE>
Thank you!
For example, in the file I might have something like: "LAT...LON 4435 9351 4821 9238 TIME" and I'd like to have $lat1 = 4435, $lon1 = 9351, $lat2 = 4821, $lon2 = 9238, etc.
Can anyone offer any help on how I could construct this regex? It is all being read from a file called file.txt as follows:
open(FILEHANDLE, "file.txt");
@text = <FILEHANDLE>
Thank you!