cyberchief Posted May 25, 2006 Report Share Posted May 25, 2006 I need to find a variable date within a Variable String... example... I need to look and see if there is a date of May 2006. It could be any day... and the date format is 05/15/2006. It could be any day within the month... I just need to find if May 2006 exists and do some functions if it does. Is this possible without using up a ton of variables? Quote Link to comment Share on other sites More sharing options...
kevin Posted May 25, 2006 Report Share Posted May 25, 2006 Here is one idea: This sample has been edited to correct a mistake: // Copy variable containing entire string to a work variable Variable Modify String: Copy %T1% to %T90% // Set T13 to ASCII char CR Variable Set %T13% to ASCII Char of 13 // Set T10 to ASCII char LF Variable Set %T10% to ASCII Char of 10 // Replace all CRs and LFs with a space Replace "%T13%" with " " in %T90% Replace "%T14%" with " " in %T90% // Replace all periods followed by a space ". " with " . " Replace ". " with " . " in %T90% If Variable %T1% contains " 05/" AND If Variable %T1% contains "/2006 " // Here: we know that T1 contains 05/xx/2006 End If One refinement might be to test the characters between " 05/" and "/2006 " to make sure that there are 2 of them and that they are numbers. Quote Link to comment Share on other sites More sharing options...
cyberchief Posted May 25, 2006 Author Report Share Posted May 25, 2006 Thanks Kevin. Problem is that the spreadsheet I am working off of has mulitple dates... It can have up to 5 "05/" (for 2000 through 2005) and up to 12 "/2005". I think I have found a work around... I am just finding the first /2005, setting the interger, subtracting 6, and copying the 2 digit month to see if it equals "05" text. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.