Jump to content
Macro Express Forums

More parsing


MEnewb1143
 Share

Recommended Posts

Hope this isn't redundant! :) I think I got the basics of parsing, but I need to go a tad further with it. The emails I get have 3numbers, dash, 7, dash, 7. Is there a way to look for these? It's all numbers and no "text". The format is also the same every time, 3-7-7. After the clipboard copies it, how do I strip out that number?

 

Thanks again!!

Link to comment
Share on other sites

Use the Variable Set String command and save the clipboard contents to a text string variable. Then use the Replace Substring option in the Variable Modify String command.

 

Variable Set String %T1% from Clipboard

Replace "-" with "" in %T1%

 

Replace the dash with nothing.

 

This will change a string such as 123-7-7 to 12377. I assume that is what you are looking for.

Link to comment
Share on other sites

Almost. :) What I'm trying to do is find that number that's 3-7-7. The dashs need to be in there, it's just that number is different each time.

 

Example:

 

blah blah blah 123-1234567-1234567 blah blah blah blah

 

How do I get just the number? They could refer to numbers in other parts of the email, so the "3numbers"-"7numbers"-"7numbers" would have to be specific to what needs to be extracted.

 

Thanks!

Link to comment
Share on other sites

I have searched for numbers in a string before. I wrote about it on this site earlier. I'm not sure if it can be adapted to what you want, but think it might. Go to SEARCH on this website and type in johnboy. You will get a list of articles. Look at the one that says "Make ME recognize dates" My posting to that question is listed under johnboy691. There is also some scripting in it you can look at. Hope it helps.

 

John

Link to comment
Share on other sites

I haven't looked at John's example, but here is how I would approach this.

 

 

Variable Set String %T1% from Clipboard

Variable Set Integer %N1% from Position of Text in Variable %T1% - Look for the position of the "-" in the text.

Variable Modify Integer: %N2% = %N1% - 4 - Subtract 4 to find the last character before the number string.

Variable Modify String: Delete Part of %T1% - Delete the text up to the number string - %N2% characters

Variable Modify String: Copy Part of %T1% to %T2% - After deleting the string, copy the next 19 characters, the numbers plus dashes to variable T2.

 

This will work if your text does not contain any other dashes before your number string. If it does, then you would need to put some logic in place to handle it.

Link to comment
Share on other sites

Thanks guys! All of that 'makes sense' but don't know how to apply it yet. I've got 'the book' on the way and hope to understand this stuff one day. I definently don't leech everythinI can hoping that you guys will make a macro for me. I spend a few hours a day on this believe it or not. Just want you guys to know, I'm willing to work at this. :) Where did you guys learn this stuff?

 

Thanks!

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...