Searching using data from clipboard (Macro)

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Raulm
Posts: 2
Joined: Tue May 23, 2006 8:56 pm

Searching using data from clipboard (Macro)

Post by Raulm »

Hi all,
I have been very impressed with the expertise found in this forum.

I have a question. I hope someone can help me.

I am trying to write a macro that is capable of pasting variable data (the content of the clipboard) into the search command.

For example:
in document 1 I will have:

John Martin | Licence# 12345|
Karl Michael | Licence# 3456657|
Jane Smith | Licence # 656789|
.
.
.

In document 2 I will have:

Member name: #12345 - status: paid - gender : male - age 24
Member name: #3456657 - status: owing - gender: male - age 56
Member name: #656789 - status: owing - gender: female - age 27
.
.
.

I would like to be able to
-search sequentially in doc 1 for a licence # (e.g. 12345),
-copy the name correspoding to licence 12345 (John Martin).
- go to document 2 and do a search for the string 12345
- replace the word "Member name" for the content of the clipboard (John Martin)

In the end, my document 2 would look like this:

John Martin: #12345 - status: paid - gender : male - age 24
Karl Michael: #3456657 - status: owing - gender: male - age 56
Jane Smith: #656789 - status: owing - gender: female - age 27

Thanks for any help you could lend me.

Regards,

Raoul
MichaelD
Posts: 7
Joined: Mon May 22, 2006 11:56 am
Location: Bothel, Germany

Post by MichaelD »

Hi!

I think this could be done mor easily using Excel or Access

Greets,
Michael D
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

I believe openoffice.org also has a free version of an Access-like database. What you are looking to do is import your two text files into tables and then do a query where you join together on the license number.
I choose to fight with a sack of angry cats.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

TextPad macros do not handle dynamic copy/paste. When you record a macro that does that, the values become hardcoded in the macro so the next time you run, you will not be doing any real time copy/paste.

This could be done with a tool like Macro Scheduler or with a database as mentioned in previous posting
Hope this was helpful.............good luck,
Bob
Raulm
Posts: 2
Joined: Tue May 23, 2006 8:56 pm

Post by Raulm »

Thank you guys!
I appreciate your feedback.

Good luck!

Bob Hansen: that picture of you looks interesting!
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Makes my momma proud!
Hope this was helpful.............good luck,
Bob
Post Reply