Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Split string based on N number of spaces

Status
Not open for further replies.

Elcarabanchel

Technical User
Apr 23, 2013
1
0
0
AU
Hi there,

I have an address string in the following format:
14 Smith Road Sydney NSW 2000

and want to split it to be: "14 Smith Road" in one field and "Sydney NSW 2000" in another.
I thought I could split the string after the 3rd space but couldn't find a way to do it.
Does anyone know of a formula to separate a string based on an n number of spaces? Or any other way to achive that?
Thanks
 
You can join the splits back together

@Road
split(yourfield, ' ')[1] &" "&split(yourfield, ' ')[2] &" "&split(yourfield, ' ')[3]

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top