Reply
Frequent Visitor
Posts: 9
Registered: ‎10-21-2016
Accepted Solution

Extract Lat and Log from csv with a google link column

[ Edited ]

I have a text file with a column that has thousands of records with the google links maps as I show it below:

 

https://www.google.com/maps/place/2%C2%B003'02.4%22S+79%C2%B054'42.5%22W/@-2.0506784,-79.9139984,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0x0!8m2!3d-2.0506784!4d-79.9118097?hl=es

 

In some links there is a different position.

 

How do I extract the latitude and longitude of that link?

 

Marco


Accepted Solutions
Established Member
Posts: 183
Registered: ‎03-22-2018

Re: Extract Lat and Log from csv with a google link column

This work for your data @mrbajana?

Column = 
VAR countLeftText =
    FIND ( "/@", Table1[hyperlink] ) + 1
VAR leftText =
    LEFT ( Table1[hyperlink], countLeftText )
VAR makeLeftBlank =
    REPLACE ( Table1[hyperlink], 1, countLeftText, "" )
VAR findLat =
    FIND ( ",", makeLeftBlank ) - 1
VAR latText =
    LEFT ( makeLeftBlank, findLat )
VAR findLong =
    FIND ( ",17z", makeLeftBlank, findLat + 1 )
VAR longText =
    LEFT ( makeLeftBlank, findLong - 1 )
RETURN
    longText

View solution in original post


All Replies
Established Member
Posts: 183
Registered: ‎03-22-2018

Re: Extract Lat and Log from csv with a google link column

This work for your data @mrbajana?

Column = 
VAR countLeftText =
    FIND ( "/@", Table1[hyperlink] ) + 1
VAR leftText =
    LEFT ( Table1[hyperlink], countLeftText )
VAR makeLeftBlank =
    REPLACE ( Table1[hyperlink], 1, countLeftText, "" )
VAR findLat =
    FIND ( ",", makeLeftBlank ) - 1
VAR latText =
    LEFT ( makeLeftBlank, findLat )
VAR findLong =
    FIND ( ",17z", makeLeftBlank, findLat + 1 )
VAR longText =
    LEFT ( makeLeftBlank, findLong - 1 )
RETURN
    longText