

If your information is inconsistent with respect to the number of lines, you will have to work a little harder. Print OUTPUT "$name:$addr,$city:$home_phone:$mobile_phone:$email\n" Print OUTPUT "Name:Address:Home Phone:Mobile Phone:Email\n" Open(INPUT,"$output_file") || die "Can't open $output_file for writing!\n"
#MAP TO PINPOINT LOCATIONS CODE#
The code below is setting up the input and output file, reading through the address listing, assigning each of the six fields to a variable that it writes to the output file once it reaches the sixth line, and then resetting the line number and starting with the next record. Substitute your preferred language if you don’t like Perl. (123) 567-8901 the information you’re working with is consistently six lines and in the same order, parsing is dead easy. So, let’s look at our sample data again: Anne Marie Palmer I use xlsx which can be generated by Excel, Open Office Calc and probably other spreadsheets as well. I’m not familiar with all of these formats. Google maps will accept data from any of these formats: If you use this format, you then need to load the reformatted data into a spreadsheet and save it in a format such as xlsx. The format above is a variation on the CSV format in that the fields are separated by colons to allow us to include commas within the fields. Working with fields containing commas makes using traditional CSV (comma-separated values) very tricky. In preparation of loading the data into a Google map, you’re going to need to reformat the list you’re starting with into a format that looks like this: Anne Marie Palmer:123 Songbird Lane:Winchester, VA 22601:(123) 456-7890 (home):(123) 567-8901 (mobile) These observations should prove very useful. In the unlabeled example above, you might notice that four of the lines include numbers, one has an sign and the last has neither of these things. Overall, labels are helpful, but they are not always needed. You might also have some entries where no email address is included. If other entries have only five - maybe no home or mobile number - your parsing has to be a little more complicated. (123) 567-8901 of these entries has six lines. Does each entry in the address list have the same numbers of lines? Are the lines labelled in some way? Are the fields in the same order? Here are two examples: A labeled listing Name: Anne Marie PalmerĮmail: An unlabeled listing Anne Marie Palmer The first thing you should do is examine the list of addresses and determine how consistent it is. Say you have an address list for some organization that you belong to and you want to see how geographically dispersed the members are. Click on some markers and make sure it works as expected - as in the example below.Upload the information from the CSV file or spreadsheet onto the map.


Put the extracted fields into a CSV (comma-separated value) or related format that Google maps can use.Parse the address list to pull out the relevant information.
