Jump to content
Macro Express Forums

How To Filter Out Some Text?


burt
 Share

Recommended Posts

I want to use a portion from a text string to use. The text begins at the clipboard.

 

Example

 

Raw text on clipboard:

Message-ID: <cvhgf6$us6$1@sport.gtinternet.org> Subject: Accuracy with January report Author: "Stony" <stony@openworld.org> Date: Tue, Feb 22 09:27

 

The result has to be:

Accuracy with January report

 

 

So this is what should be deleted at the leftside:

Message-ID: <cvhgf6$us6$1@sport.gtinternet.org> Subject:

 

and this on the rghtside:

<TAB>Author: "Stony" <stony@openworld.org> Date: Tue, Feb 22 09:27

 

The text string doesn't always start with Message-ID: but it is also not random. A few other known words are possible.

 

 

Notice the using of tabs which are used at the leftside from Subject:, Author: and Date:

 

What's always the same is the word Subject: It will be always there.

Also the word Author: is what all these text strings will have in common.

 

Can this be done in Macro Express?

Link to comment
Share on other sites

Welcome Burt,

 

Below is code that will do just as you wish. It finds "Subject:" and "Author" and will copy the text found in between these two fields into varialbe %T1%.

 

Clipboard Copy
Variable Set String %T1% from Clipboard
Variable Set Integer %N1% from Position of Text in Variable %T1%
Variable Set Integer %N2% from Position of Text in Variable %T1%
Variable Modify Integer: %N1% = %N1% + 9
Variable Modify Integer: %N3% = %N2% - %N1%
Variable Modify String: Copy Part of %T1% to %T1%
Text Box Display: Result

 

<CLIPC><TVAR2:01:03:><IVAR2:01:13:1:Subject: ><IVAR2:02:13:1:Author><NMVAR:01:01:1:0000001:2:0000009><NMVAR:02:03:1:0000002:1:0000001><TMVAR2:10:01:01:N01:N03:><TBOX4:T:1:CenterCenter000278000200:000:Result%T1%>

Link to comment
Share on other sites

Thanks Cyberchief!

 

A working solution within 15 minutes :)

It workes fine.

 

I had a dummy solution with using of notepad and the search and replace option, but I thought there should be a more intelligent way without the need of external programs.

 

I will study your code and see if I can manage to get the author info extracted myself.

And sometimes there will be more lines on the clipboard from which I only use the first line to determine the subject.

 

 

Thanks again!

 

Bye, Burt

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