Replacing quotation marks with “``” and “''”
I have a document containing many " marks, but I want to convert it for use in TeX. TeX uses 2 ` marks for the beginning quote mark, and 2 ' mark for the closing quote mark. I only want to make changes to these when " appears on a single line in an even number (e.g. there are 2, 4, or 6 " 's on the line). For e.g. "This line has 2 quotation marks." --> ``This line has 2 quotation marks.'' "This line," said the spider, "Has 4 quotation marks." --> ``This line,'' said the spider, ``Has 4 quotation marks.'' "This line," said the spider, must have a problem, because there are 3 quotation marks." -