I have a .txt file which contains 125,000 entries of sightings of mammals. Each line of the file has a species name, latitude and longitude (place of the sighting). I have to write a subroutine 'LocationCount' which returns the number of animals found within a specified
distance of a given location. This should take four parameters: a file name containing the
data, a distance in kilometres, and the latitude and longitude of the location. It should then return the
number of animals found within the specified distance of the location.
There are many other things I need to add in to this but I cannot get past the first step.
I first need to load the file into a list which I have successfully done. For every line in the list I then need to split the line into its three components: species name, latitude and longitude which I am struggling with. The fields are all separated by tabs.
I have attached a print screen of my work, can anyone see where I am going wrong. I have tried many variations.