Help with MACRO

General questions about using TextPad

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

Post Reply
karipay
Posts: 12
Joined: Thu Feb 05, 2009 10:26 pm

Help with MACRO

Post by karipay »

Hi,

Is there a way i can create a MACRO to search for words and each word will be put it in a new line? Also, each word can repeat multiple times (> 100) and is placed randomly in the text file.

EX. Word1word2word3word4word5word6word2word1word6word99word......

I wanted the result to be like this.
word1
word2
word3
word4
word5
word6
word2
word1
word6
word99
word.....

Thanks in advance!
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

How do you define a word? Is it a non-empty sequence of letters, followed by a possibly empty sequence of digits?

IF so, this Search | Replace... (<F8>) will do it:
Find what: [a-z]+[0-9]*
Replace with: \0\n

[X] Regular expression

Replace All
You wrote
each word can repeat multiple times (> 100) and is placed randomly in the text file.
I don't know the significance of this.
karipay
Posts: 12
Joined: Thu Feb 05, 2009 10:26 pm

Post by karipay »

Sorry bout the confusion but thanks for the idea!
Post Reply