awk sed parsing

hi , i would like to parse some file with the fallowing data :

data data data "unwanted data" data data "unwanted data"
data data data data #unwanted data.

what i want it to have any coments between "" and after # to be erased using awk or/and sed.

has anyone an idea?

thanks.

Something like:

[GNU Sed]

sed 's/\("[^"]*"\|#.*\)//g' file

Other seds:

sed 's/"[^"]*"//g;s/#.*//' file
sed -e 's/#.*//g' -e 's/"[^"]*"//g' infile

should do what you want

thanks a lot.

sed 's/"[^"]*"//g;s/#.*//' file does exactly what i want.