remove lines without :

General questions about using TextPad

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

Post Reply
f000ker
Posts: 16
Joined: Mon Jan 10, 2005 11:43 pm

remove lines without :

Post by f000ker »

is there away to remove lines that dont contain domthing for example
dsfsdfdfsdf:dsffdsd
dsfssfssdffsfsfs
gdhgfhhgshgf:fdgdgfdfdg
gdgfgfdgdfgdfgdgfdgfdg:343434
344334443:454545




it would remove dsfssfssdffsfsfs because it doesnt have :

Anyone?
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Do a find on the ":" with mark all. Invert all bookmarks, delete bookmarked lines. HTH
Then I open up and see
the person fumbling here is me
a different way to be
f000ker
Posts: 16
Joined: Mon Jan 10, 2005 11:43 pm

Post by f000ker »

s_reynisson wrote:Do a find on the ":" with mark all. Invert all bookmarks, delete bookmarked lines. HTH
ah smart thanks :)
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Since it's a single character (":") that you're looking for the absence of, you can search for the regular expression that matches lines containing only characters that aren't ":"
^[^:]*\n
and replace them with nothing.
f000ker
Posts: 16
Joined: Mon Jan 10, 2005 11:43 pm

Post by f000ker »

nice 2 good responces thanks guys

ben_josephs wrote:Since it's a single character (":") that you're looking for the absence of, you can search for the regular expression that matches lines containing only characters that aren't ":"
^[^:]*\n
and replace them with nothing.
Kevin
Posts: 28
Joined: Tue Apr 01, 2003 7:55 pm

Post by Kevin »

Code: Select all

^[^:]*\n
Works for a single character. How do I do this for multiple characters?
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

You can't. Use s_reynisson's method instead.
Post Reply