Closed Thread
Results 1 to 2 of 2

Remove variable accuracies strings from kml coordinates

  1. #1
    Registered User
    Join Date
    01-26-2020
    Location
    Amsterdam
    MS-Off Ver
    16
    Posts
    17

    Remove variable accuracies strings from kml coordinates

    Dear all (or BMV),

    I would like to continue with my problem posted in a previous thread. I have thousands of kml files that need to converted to geojson. For that I need to remove the accuracy that is integrated in the kml coordinate string (explained in the start of this threat). BMV provided me with a great solution to remove the accuracy string with VBA coding (see attached excel). Unfortunately, the solution does not cover my entire dataset. It appears that some of my kml records (coordinate strings) do not have an accuracy string at all (see example below at point b)). So I sometimes have the following coordinate combinations in my kml strings (each coordinate set seperated by a space):

    Occurences of kml strings in my dataset (Lon , lat , accuracy):
    a) [space]-43.483182,-22.544959,0.0[space]
    b) [space]-43.483182,-22.544959[space]
    c) [space]-43.483182,-22.544959,3.567[space]
    d) [space]-43.48318266,-22.54495944,35.566[space]

    The script of BMV nicely removes the accuracy from the kml coding (see excel provided by him/her in this threat), either 0.0's or other accuracy values (e.g. 3.567). However, the problem with the script that BMV provided is that it removes always the accuracy based on a comma, even in case of b) (so when there is no accuracy string) (see red cell in example excel). So in case there is no accuracy, the script removes the lat value... And that gives problems. For the rest, the script created by BMV works perfect. Is there a way the BMV script can be modified so that it only removes accuracy when it is there? So only in case there are 3 comma's in a string....? Many thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Remove variable accuracies strings from kml coordinates

    Administrative Note:

    Unfortunately, this is a duplicate thread, and you are allowed only ONE thread per issue here.

    Please see Forum Rule #5 about thread duplication.

    I am closing this thread, but you may continue here in the original thread: https://www.excelforum.com/excel-gen...-wildcard.html
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Get strings between two strings in text file and remove the rest
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 10-15-2018, 10:18 AM
  2. Replies: 5
    Last Post: 06-18-2015, 09:10 AM
  3. [SOLVED] Remove only numeric strings from a value in the cell
    By pgft in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-02-2015, 01:29 PM
  4. [SOLVED] remove everything between two strings in cell value
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-29-2013, 11:56 PM
  5. remove everything between two strings in cell value
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2013, 11:26 PM
  6. [SOLVED] How to remove duplicates from a column of strings
    By hennaleena in forum Excel General
    Replies: 4
    Last Post: 11-07-2012, 05:27 AM
  7. Convert point coordinates -> pixel coordinates
    By Zorro in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2006, 10:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1