# Entering a list of coordinates into Google Earth

**URL:** <https://boards.straightdope.com/t/entering-a-list-of-coordinates-into-google-earth/399860>\
**Category:** Factual Questions\
**Created:** [April 12, 2007, 9:38pm UTC](https://boards.straightdope.com/t/entering-a-list-of-coordinates-into-google-earth/399860 "2007-04-12T21:38:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CynicalGabe](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@CynicalGabe](https://boards.straightdope.com/u/CynicalGabe)\
**Post date:** [April 12, 2007, 9:38pm UTC](https://boards.straightdope.com/t/entering-a-list-of-coordinates-into-google-earth/399860/1 "2007-04-12T21:38:27Z")

</div>

I have a list of several hundred lat/lon coordinates in a Microsoft Access file. They are in a single column, decimal format, comma separated. Ex: 12.34, 67.89

What is the easiest way to convert this to a Google Earth kml or kmz file, in which each coord is a placemark? I’ve been searching for about an hour, trying various little command line tools with no success, and my brain is tired. Help, please.

---

<div class="post-metadata">

**Author:** ![Omphaloskeptic](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@Omphaloskeptic](https://boards.straightdope.com/u/Omphaloskeptic)\
**Post date:** [April 12, 2007, 11:40pm UTC](https://boards.straightdope.com/t/entering-a-list-of-coordinates-into-google-earth/399860/2 "2007-04-12T23:40:54Z")

</div>

Just write a simple Perl script. Here’s the [KML reference](http://earth.google.com/kml/kml_tags_21.html) and [tutorial](http://earth.google.com/kml/kml_tut.html). Here’s a very simple example, which assumes a CSV file full of \<lat\>,\<lon\> pairs as the first two fields on the line; the names assigned are just the line numbers.

```auto

#!/usr/bin/perl

print <<"HDR";
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Folder>
HDR

while ( <STDIN> ) {
  chomp;
  my @ll = split /,/, $_;
  print <<"REC";
  <Placemark>
    <name>$.</name>
    <Point><coordinates>$ll[1],$ll[0],0</coordinates></Point>
  </Placemark>
REC
}

print <<"FTR";
</Folder>
</kml>
FTR

```

RTM to customize as you like.

---

<div class="post-metadata">

**Author:** ![CynicalGabe](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@CynicalGabe](https://boards.straightdope.com/u/CynicalGabe)\
**Post date:** [April 13, 2007, 3:08pm UTC](https://boards.straightdope.com/t/entering-a-list-of-coordinates-into-google-earth/399860/3 "2007-04-13T15:08:23Z")

</div>

Thanks! That worked great!
