Weeding out word shorter than five characters

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
Leif

Weeding out word shorter than five characters

Post by Leif »

I have a list of 100,000 words. I want to delete all words that are 1 to 4 characters long. How do I do this? I've tried different sortings but so far to no avail.
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

That is not clear.

Do you mean you have a file containing words of alphabetic characters, one per line, with no white space, and you want to delete every line containing a word less than five characters long? If so, this will do what you want:
Find what: ^[a-z]{1,4}\n
Replace with: [nothing]

[X] Regular expression

Replace All
This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Leif

Post by Leif »

Thank you very much! Just what I needed! Worked like a dream.
Post Reply