Johhhn Posted July 29, 2015 Posted July 29, 2015 Hi, I need help removing certain text from a text field. Below is the sample text. Basically, in this case, I need all the text removed (including the date) starting at 11/19/2013 and ending at the last phone number of, in this case, Jeff Kate. Some records may only have two contacts- this one has three. And it's possible that the Work # may be blank, but if it is, the text "Work:" will still be there. There may be text in this field that doesn't have this format (date time stamp, name, cell, home, work). That stuff I need to keep. Thanks in advance for any help! 11/19/2013 4:46:31 AM Bob Smith Cell: (555) 555-1212 Home: (555) 555-1212 Work: (555) 555-1212 11/19/2013 4:46:30 AM Laura Pluto Cell: (555) 555-1212 Home: (555) 555-1212 Work: 11/19/2013 4:46:30 AM Jeff Kate Cell: (555) 555-1212 Home: Work: (555) 555-1212 89/11Emergency Contacts: Bill Smith (aunt) (555) 555-1212 and Tim and John Henry (uncle) (555) 555-1212
comment Posted July 29, 2015 Posted July 29, 2015 I am afraid that's not clear enough. Is that an example of the contents of a single field of a single record? Is there anything before the date, and if yes is it always the same date? If I am guessing correctly and you want the part of the (entire) text after the last line that starts with "Work:", then you could probably use = Let ( [ len = Length ( text ) ; marker = Position ( text ; "¶Work:" ; len ; -1 ) ; end = Position ( text ; ¶ ; marker ; 3 ) ] ; Right ( text ; len - end ) ) Note that this assumes there's an empty line separating the phones and the rest of the text.
Johhhn Posted July 29, 2015 Author Posted July 29, 2015 I am afraid that's not clear enough. Is that an example of the contents of a single field of a single record? Is there anything before the date, and if yes is it always the same date? If I am guessing correctly and you want the part of the (entire) text after the last line that starts with "Work:", then you could probably use = Let ( [ len = Length ( text ) ; marker = Position ( text ; "¶Work:" ; len ; -1 ) ; end = Position ( text ; ¶ ; marker ; 3 ) ] ; Right ( text ; len - end ) ) Note that this assumes there's an empty line separating the phones and the rest of the text. That works perfectly!! thank you so much! btw, do you have any references where one could learn text manipulation like this? It's always been a weakpoint of mine I'm afraid.
Recommended Posts
This topic is 3775 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