Thanks for the replies!
drawde, your first script almost works like you said..
druuna, I should have also mentioned that comment 1, 2, 3 can be anything and doesn't have to end with a digit. Basically if a string starts with '--' it's a comment.
The file actually represents a long sql script where i need to strip off the formatting, ie the new lines. If you have any other ideas please post!