Add character in string before first number occurrence
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi All,
I'm cleaning up addresses and I need to add a comma and a space before and after each set of numbers i.e.
Av. El Parque 4160 Piso 5 needs to be
Av. El Parque, 4160, Piso 5
This is not always the case, heres a piece of my dataset
Av. Santa Maria 2474, Providencia
Los Carreras 444, Melipilla
Rosario Norte 407, Piso 13, Las Condes
Huérfanos 670
La Concepción 332, Piso 7
So the thing is, sometimes there are 3 number characters with a comma at the end, also sometimes there are 4 number characters with a comma at the end and sometimes there are no commas.
Is there a way to do this using regex or should I just star making a Find and Replace table.
Thanks!
Solved! Go to Solution.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @luismorales, this works with your example as you mentioned it's needed when there are 3/4 numbers but I'd check it with a larger dataset and see if any issues come up that may need to be addressed with other logic etc:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@FinnCharlton , @DataNath. thank you very much both approaches worked.
