burt Posted May 11, 2005 Report Share Posted May 11, 2005 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? Quote Link to comment Share on other sites More sharing options...
cyberchief Posted May 11, 2005 Report Share Posted May 11, 2005 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%> Quote Link to comment Share on other sites More sharing options...
burt Posted May 11, 2005 Author Report Share Posted May 11, 2005 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 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.