Importing HTML tags from .TXT files --

3 views
Skip to first unread message

bgalland

unread,
Sep 7, 2006, 2:47:17 PM9/7/06
to KML Discussions
I'm pretty much stumped on this one. I have a long list of data I have easily imported into GE Plus but I'd like to clean it up a little bit. I've used Excel for the data entry so when I import I get something that looks like this in the description balloon:

SiteName
Title = SiteName
Info = xxxxxxxxxxx
Info = xxxxxxxxxxx
Info = xxxxxxxxxxx
Info = xxxxxxxxxxx
Latitude = 80.0000000
Longitude = -80.000000

I haven't had a problem getting the information in there. What I'd like to do now is break up the information lines a little bit so it comes across looking something like this:

SiteName
Title = SiteName
Info = xxxxxxxxxxx
Info = xxxxxxxxxxx

Info = xxxxxxxxxxx
Info = xxxxxxxxxxx

Latitude = 80.0000000
Longitude = -80.000000

I've tried adding HTML code (line breaks <BR>) to the spreadsheet prior to saving as a TXT file, but on import it comes across looking like this:

SiteName
Title = SiteName
Info = xxxxxxxxxxx
Info = xxxxxxxxxxx
_BR_ =
Info = xxxxxxxxxxx
Info = xxxxxxxxxxx
_BR_ =
Latitude = 80.0000000
Longitude = -80.000000

If anyone knows can help me get some line breaks in the data in the balloons other than manually doing it once the data has been imported I'd greatly appreciate it...I'm really hung up on this one.

Forkboy2

unread,
Sep 7, 2006, 10:29:32 PM9/7/06
to KML Discussions
If you have MS word you can do a search and replace to insert the break above the latitude line. Other one will be more difficult unless the 4 different things you have listed as "Info" are actually some unique value.

Just search and replace and add ^P I believe it is to insert the CR.

Matt

mcshea98

unread,
Sep 8, 2006, 1:24:08 AM9/8/06
to KML Discussions
bgalland,

Forkboy2 is correct on the procedure; however, if you use the "Failed attempt" you can do a search for "_BR_ =" and replace with "<BR>".

Hope this helps,

mcshea98

p.s. You may have to add in the <!CDATA[ ............]]> around your information in the <description> tag.

bgalland

unread,
Sep 8, 2006, 1:31:21 PM9/8/06
to KML Discussions
Okay, I tried adding in the ^P with no luck. On import, it comes over like:
_P = ^P

The information I'm pulling over I've inputted into Excel with my labels on Row 1 in this format:

A B C D E F G H
1 Info Info Info Info Info Info Latitude Longitude
2 ### ### ### ### ### ### 34.000 -80.0000

I save the file as a .txt file and Google Earth pulls the info line by line, so the information from Row 2 will contain values from A-H. When it comes over, the GE balloons show up as:

Info =
Info =
Info =
Info =
Info =
Info =
Latitdue =
Longitude =

Once I add in the ^P by adding columns I have something like this:

A B C D E F G H
1 Info Info ^P Info Info ^P Latitude Longitude
2 ### ### ^P ### ### ^P 34.000 -80.0000

And GE's import comes out looking like this in the balloon:

Info =
Info =
_P = ^P
Info =
Info =
_P = ^P
Latitdue =
Longitude =

I just seem to be running into a brick wall here. Maybe there's another route to take? Can I save the folder with my information as a KMZ and open it with another editor and use the find and replace function?

Thanks for the guidance so far!

mcshea98

unread,
Sep 8, 2006, 11:50:00 PM9/8/06
to KML Discussions
bgalland ,

If you post your kmz file (or part of it), I will convert part of it and show you the process for doing so.

The basic premise is to have Google Earth to import the file. Then once it is in your My Places, save it as a .kml file, not .kmz. If you do this, you can "Open with..." Wordpad (or similar text editor). Once it is open conduct a find and replace. See example..

Code:
<kml>
.
.
.
<description><!CDATA[
Info = ####
Info = ####
_P = ^P
Info = ####
Info = ####

_P = ^P
Latitdue =
Longitude =
.
.
.
]]>
</description>
.
.
.


Find "_P = ^P" and Replace with "<br/>"

If your code is missing the "<!CDATA[ . . . ]]>" portion of your <description> tag, you can add it to all your placemarks by doing a similar type "Find and Replace"

Hope this helps,

mcshea98

bgalland

unread,
Sep 11, 2006, 2:56:02 PM9/11/06
to KML Discussions
Excellent, got it figured out, thanks so much.

Now is there a way to adjust the size of the description balloon?

tekgergedan

unread,
Sep 12, 2006, 5:22:28 AM9/12/06
to KML Discussions
Hi

Use a <table> as the main form of your <Description>. You wont be able to manipulate the heigh much but the width.
Reply all
Reply to author
Forward
0 new messages