enquirerfm Posted October 23, 2010 Posted October 23, 2010 I have a field which contains the data imported and which I wish to breakdown. One of the elements I wish to extract is a four digit no for the year, and then post this to another field. e.g. Charmes Chambertin, Tres Vieilles Vignes 1999 (12) I need '1999' to post to another field. The no. of words before the year changes - can be 1, 2, 3, 4 or as here 5. There is always a number after this in brackets, as here e.g. '(12)'. Perhaps that helps? Any help much appreciated> Thank you.
comment Posted October 23, 2010 Posted October 23, 2010 Can there be any digits and/or brackets in the text before the year?
enquirerfm Posted October 23, 2010 Author Posted October 23, 2010 Thanks. There can be the odd thing like '1er' (my apostrophes) but so seldom it's not worth doing anything with this and can change manually as the year is inserted into a field which compares to a value list. Also, sometimes a '5' or '6' on its own but again v. rare. Otherwise no brackets or digits.
Raybaudi Posted October 23, 2010 Posted October 23, 2010 Try: RightWords ( GetValue ( Substitute ( text ; "(" ; ¶ ) ; 1 ) ; 1 ) ( there must be no carriage ruturn into the original text )
LaRetta Posted October 23, 2010 Posted October 23, 2010 Or [color:blue]Leftwords ( RightWords ( text ; 2 ) ; 1 ) ... but is it clear that there is no text after what has been given for an example? :wink2:
Recommended Posts
This topic is 5145 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