I would like a batch that reads a file called ships.txt, then takes the entries (each on a line) from that file and compares them to a file with the file extension of *.map (say test.map), looking for the match, which will always be at the end of a line. Then take those coordinates (they will be a pair of numbers that are actually long. and lat. in meters) and plug those coordinates into a perl script, which produces a file. I'd like then to read the file that is produced by the perl script and delete an entry that is found within another file using information from the perl script by-product.
Lets start from scratch. One step at a time Step 1:
- I would like a batch that compares "test.map" and "ships.txt". If it finds a match, and the match will always be at the end of a line in test.map, I'd like it to grab map coordinates.
This is what test.map will look like:
Code:
Pt0=14497903.00,-813490.00,0.00,Mark 1
Pt1=14417253.00,-812258.00,0.00,Mark 2
etc...
ships.txt will look something like this:
Mark 1
Mark 3
etc...
So I'd like the batch to read ships.txt and be looking for the entry "Mark 1" or "Mark 2" etc..., and if it is found in test.map, to grab the coordinates just before the ",0.00,Mark #" Notice the coordinates have two decimal places and they can also be negative.
How is this done?