Newbies matty47 Posted June 21, 2011 Newbies Posted June 21, 2011 HI, I've tried to sort this without success, and probably because I'm not clever enough, I wish to extract the number, which may be a one to three digit number, from a field like Albert Street - Segment 2 33 The only thing that is guaranteed is that it is the number directly after the word Segment. In the above I only want the 2. I am sure that there is a simple answer and that I will kick myself later. Thanks for any help Matthew
comment Posted June 21, 2011 Posted June 21, 2011 I am sure that there is a simple answer I am not. Will there always be a space between "Segment" and the number? And will there always be a space following the number?
Newbies matty47 Posted June 21, 2011 Author Newbies Posted June 21, 2011 I am not. Will there always be a space between "Segment" and the number? And will there always be a space following the number? Yes. The number will always be separate.
comment Posted June 21, 2011 Posted June 21, 2011 Try = Let ( [ pos = Position ( text ; "Segment " ; 1 ; 1 ) ; w = WordCount ( Left ( text ; pos - 1 ) ) ] ; Case ( pos ; MiddleWords ( text ; w + 2 ; 1 ) ) )
Recommended Posts
This topic is 4962 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now