How would you delete all comments using sed from a file(defined with #) with respect to \'#\' being in a string?
This helped out a lot except for the string portion.
sed 's:^#\(.*\)$:\1:g' filename
Supposing the lines starts with single # comment, Above command removes all comments from file.