Jump to content
Macro Express Forums

Make ME "recognize" dates??


kunkel321
 Share

Recommended Posts

Hi All,

I don't think this is possible, but thought I'd ask anyway...

Is there a way to have a macro "process" a sring of text and extract any dates?

My thought is that I would use some token such as **/**/** or maybe a regular expression like [0-9][0-9]/[0-9][0-9]/[0-9][0-9].

Macro Express would then recognize this pattern in the string of text and extract it as a substring.

I could then use the date in other macro commands.

===

An example of how this could be used is that I might get an email that says:

"Hey Steve we're all meeting at Site B on 2-17-08 to go over this and that. Please try to attend."

I could run this entire bit of text through a macro and ME would be able to pick out the date from the rest of it...

See what I mean?

===

Thoughts? Thanks :) -steve

Link to comment
Share on other sites

Ok, I'll share what I have done to find some numbers in a string (possibly up to 69 characters in length). It was made a couple years ago when I was still green behind the ears when it came to ME. I'm sure there are better ways to do it, but it works for me and I haven't had the time to re-work it. Maybe it will give you an idea. I'm sure you can replace where I have my numbers with a date format. Now, I don't want anyone laughing at this :P I process over 40,000 claims a week using it.

 

What this scripting does is copies the line of information and then moves across the line character by character grabbing and comparing 4 characters at a time. In my world it is possible there could be three or four of these numbers in the row of the string copied. Hope this helps or gives you some ideas.

 

<TEXTTYPE:<SHIFTU>><MSD:100><TEXTTYPE:<ALT>ec><MSD:100><TVAR2:20:03:><MSD:100><REM2:Copies 1st four digits from T20 string><REM2:If T20 = nothing or is null, macro will break out of edit search and continue><REP3:01:000001:000001:00001:0:01:><IFVAR2:1:20:1:><BREAK><ENDIF><REM2:Modifies the first four digits of T20 to T14><TMVAR2:10:14:20:001:004:><IFVAR2:1:14:1:4051><OR><IFVAR2:1:14:1:4054><OR><IFVAR2:1:14:1:4050><OR><IFVAR2:1:14:1:4056><OR><IFVAR2:1:14:1:4065><IVAR2:10:01:4051><ENDIF><IFVAR2:1:14:1:4055><IVAR2:11:01:4055><ENDIF><IFVAR2:1:14:1:4026><IVAR2:12:01:4026><ENDIF><IFVAR2:1:14:1:4058><IVAR2:13:01:4058><ENDIF><REM2:Modifies the second four digits (5-8) of T20 to T14><TMVAR2:10:14:20:005:004:><IFVAR2:1:14:1:4051><OR><IFVAR2:1:14:1:4054><OR><IFVAR2:1:14:1:4050><OR><IFVAR2:1:14:1:4056><OR><IFVAR2:1:14:1:4065><IVAR2:10:01:4051><ENDIF><IFVAR2:1:14:1:4055><IVAR2:11:01:4055><ENDIF><IFVAR2:1:14:1:4026><IVAR2:12:01:4026><ENDIF><IFVAR2:1:14:1:4058><IVAR2:13:01:4058><ENDIF><REM2:Modifies 6th to 9th digits of T20 to T14><TMVAR2:10:14:20:006:004:><IFVAR2:1:14:1:4051><OR><IFVAR2:1:14:1:4054><OR><IFVAR2:1:14:1:4050><OR><IFVAR2:1:14:1:4056><OR><IFVAR2:1:14:1:4065><IVAR2:10:01:4051><ENDIF><IFVAR2:1:14:1:4055><IVAR2:11:01:4055><ENDIF><IFVAR2:1:14:1:4026><IVAR2:12:01:4026><ENDIF><IFVAR2:1:14:1:4058><IVAR2:13:01:4058><ENDIF>

 

goes on and then ends with....

 

<TEXTTYPE:<SHIFTU>><MSD:100><TEXTTYPE:<ALT>ec><MSD:100><TVAR2:20:03:><MSD:100><REM2:Copies 1st four digits from T20 string><REM2:If T20 = nothing or is null, macro will break out of edit search and continue><REP3:01:000001:000001:00001:0:01:><IFVAR2:1:20:1:><BREAK><ENDIF><REM2:Modifies the first four digits of T20 to T14><TMVAR2:10:14:20:001:004:><IFVAR2:1:14:1:4051><OR><IFVAR2:1:14:1:4054><OR><IFVAR2:1:14:1:4050><OR><IFVAR2:1:14:1:4056><OR><IFVAR2:1:14:1:4065><IVAR2:10:01:4051><ENDIF><IFVAR2:1:14:1:4055><IVAR2:11:01:4055><ENDIF><IFVAR2:1:14:1:4026><IVAR2:12:01:4026><ENDIF><IFVAR2:1:14:1:4058><IVAR2:13:01:4058><ENDIF><REM2:Modifies the second four digits (5-8) of T20 to T14><TMVAR2:10:14:20:005:004:><IFVAR2:1:14:1:4051><OR><IFVAR2:1:14:1:4054><OR><IFVAR2:1:14:1:4050><OR><IFVAR2:1:14:1:4056><OR><IFVAR2:1:14:1:4065><IVAR2:10:01:4051><ENDIF><IFVAR2:1:14:1:4055><IVAR2:11:01:4055><ENDIF><IFVAR2:1:14:1:4026><IVAR2:12:01:4026><ENDIF><IFVAR2:1:14:1:4058><IVAR2:13:01:4058><ENDIF><REM2:Modifies 6th to 9th digits of T20 to T14><TMVAR2:10:14:20:006:004:><IFVAR2:1:14:1:4051><OR><IFVAR2:1:14:1:4054><OR><IFVAR2:1:14:1:4050><OR><IFVAR2:1:14:1:4056><OR><IFVAR2:1:14:1:4065><IVAR2:10:01:4051><ENDIF><IFVAR2:1:14:1:4055><IVAR2:11:01:4055><ENDIF><IFVAR2:1:14:1:4026><IVAR2:12:01:4026><ENDIF><IFVAR2:1:14:1:4058><IVAR2:13:01:4058><ENDIF> .......so on and so on.

Link to comment
Share on other sites

  • 2 weeks later...

Johnboy, this is awesome--thank you or the reply!

I took your model and tweeked it and came up with this

 

 

<CLIPC><TVAR2:04:03:><IVAR2:04:01:1><IVAR2:05:12:4><REP3:08:000002:000001:0005:1:01:T5><TMVAR2:10:05:04:N04:001:><IFVAR2:1:05:1:0><OR><IFVAR2:1:05:1:1><OR><IFVAR2:1:05:1:2><OR><IFVAR2:1:05:1:3><OR><IFVAR2:1:05:1:4><OR><IFVAR2:1:05:1:5><OR><IFVAR2:1:05:1:6><OR><IFVAR2:1:05:1:7><OR><IFVAR2:1:05:1:8><OR><IFVAR2:1:05:1:9><OR><IFVAR2:1:05:1:/><OR><IFVAR2:1:05:1:-><TMVAR2:08:06:05:000:000:><ELSE><ENDIF><IFVAR2:5:04:5:N5><EXITREP><ENDIF><NMVAR:08:04:0:0000001:0:0000000><ENDREP><TEXTTYPE:The number is %T6%.>

 

 

Directions

BEGIN

Just a "test" macro that extracts numbers from a bit of text.

 

1. From an editable text field, such a Note Pad,

2. Use mouse to highlight a line of text that contains numbers and letters.

3. Activate macro. (Hotkey activation recommended)

 

Marco will extract the characters "1,2,3,4,5,6,7,8,9,0,/, and -" then type them out.

END

 

This still needs a lot of work before it can actually "recognize dates" ... but it's pretty cool nonetheless!

 

-steve

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...