Sep 5, 2012, 10:23 AM
Post #2 of 3
Re: [SubTerran] In the file to determine the city in which there is more than one buyer
[In reply to]
you can do the following.
Read the file line by line. Split each line on the ":" into an array and take the fourth element of the array (subscript 3), the city. Trim the white spaces (although not absolutely necessary). Check if the city thus found is in a hash. If it is already there, you've got a city where there is more than one customer; if the city is not in the hash, put the city in the hash.