0

I have a data set in CSV format that includes the name of the store, full address, latitude and longitude (from Geocode).

Since address is in full format, is there a way I can get a special column that would only show the city where the store is located?

I don't know how to work in Python/SQL or other program languages.

6
  • Address is in full format does mean it's stored like 12345 Duffcity, Duffroad 67? – Erik Dec 16 '19 at 15:34
  • Paste an excerpt of the full text of the address and someone could get a clue based on it – Marco Dec 16 '19 at 15:36
  • "The Emporium Shopping Complex, Unit 1 P 12-15 , M. Floor, 622 Sukhumvit Road, Klongton Sub-district, Klongtoey District Bangkok, 10110, Thailand" – tji2019 Dec 16 '19 at 15:41
  • and you want to get "Klongtoey District Bangkok"? or are you aiming for "Bangkok"? – Marco Dec 16 '19 at 15:48
  • All lines are structured in the same way? – Vincent Bré Dec 16 '19 at 15:48
1

Use Regular Expression

\w*\b"

will find the last word before the quote "

and either and/or combine

\w*\b,

will find the last word before the comma '

(depending on your original file structure.)

You may be better off standardizing your addresses before this step.

start here https://www.tutorialspoint.com/python3/python_reg_expressions.htm

0

It sounds like you need to parse the address. If you feed the address into a geocoder it will often do the parsing for you. The results of most geocoding algorithms is not only the lat long values of the location but a parsed version of the address that was fed in.

Here's a link to a bunch of online batch geocoders that you could use to process your csv file.

https://researchguides.uoregon.edu/geocoding/free-batch

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.