3 Replies Latest reply on Jun 27, 2013 8:32 AM by Allan Walker

# Left and Right with Find

Hi, I have a field name [geo_coordinates]

I wish to create two CF's - one called latitude and the other longitude

Here is the standard output with an example:

loc: -23.02860309,-45.56177326

So, I want to strip (trim? replace?) "loc: " and then find ","

Everything Left of "," would be [latitude] and everything right of "," would be [longitude]

I'm almost there with LEFT([geo_coordinates],FIND([geo_coordinates],",")-1) for latitude... but it returns loc: -23.02860309.

Best Regards,

Allan

• ###### 1. Re: Left and Right with Find

I would start by stripping the loc with right([rest of stuff],len[string]-5)

1 of 1 people found this helpful
• ###### 2. Re: Left and Right with Find

Allan Walker wrote:

but it returns loc: -23.02860309.

Allan, is the problem that it's a string? Or is it the period at the end? Or spaces before (or after)?

--Shawn

1 of 1 people found this helpful
• ###### 3. Re: Left and Right with Find

Hi Shawn,

I actually get "loc: -23.02860309" without the full stop (US:EN "period") doing the LEFT.

Alex, that's right, can't I trim - Oh I see.  It's only for white space.

Ugh.  So much easier in Excel.

So anyway, sorted.

Longitude:

RIGHT([geo_coordinates],FIND([geo_coordinates],",")-6)

Latitude: (after) LEFT([geo_coordinates],FIND([geo_coordinates],",")-1)

RIGHT([CF - LATITUDE],FIND([CF - LATITUDE],": ")+8)

Oh, and I had to INT them to get T to recognize them for lat/long.