Page 1 of 1

remove lines without :

Posted: Thu Feb 03, 2005 6:22 pm
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?

Posted: Thu Feb 03, 2005 6:27 pm
by s_reynisson
Do a find on the ":" with mark all. Invert all bookmarks, delete bookmarked lines. HTH

Posted: Thu Feb 03, 2005 6:28 pm
by f000ker
s_reynisson wrote:Do a find on the ":" with mark all. Invert all bookmarks, delete bookmarked lines. HTH
ah smart thanks :)

Posted: Thu Feb 03, 2005 7:05 pm
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.

Posted: Fri Feb 04, 2005 5:41 am
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.

Posted: Tue Mar 22, 2005 6:20 pm
by Kevin

Code: Select all

^[^:]*\n
Works for a single character. How do I do this for multiple characters?

Posted: Tue Mar 22, 2005 10:18 pm
by ben_josephs
You can't. Use s_reynisson's method instead.