Click to See Complete Forum and Search --> : sed question


panth3r
10-17-2002, 05:51 PM
I've got a quick question,

how can i remove all of the words out of a file execpt word xyz ?

I'm assuming i can do this with sed but im having a lil trouble figureing it out from all the online tutorials (i was hoping the "sed one-liners" link would have worked but it didnt....im reading through the FAQ listed in the sed man page).

Thank's i apriciate any help/tutorials/examples

Florian

rbermejo
10-17-2002, 08:13 PM
Good tutorial .

It is in HTML, just change the extension .txt to .html

mingshun
10-19-2002, 03:44 AM
Originally posted by panth3r
I've got a quick question,

how can i remove all of the words out of a file execpt word xyz ?


Is this what you want?

sed 's/[^xyz]//g' <filename>

panth3r
10-19-2002, 02:58 PM
Cool, that worked great, i also apologize for cross posting.

Thanks!
Flo