Mike Meyer wrote:
>>> Is there a command-line tool that does this using some heuristics to
>>> cover most areas that could be problematic?

>> sed. tr, too, but sed would work. Something like s/"[A-Z,a-z]?/``?/g.
>> I didn't look at my sed book, but that reads, "substitute two single
>> backqotes when there's a plain double quote followed by a single
>> character; do this globally." You want to test that it's not a period,
>> but a letter. 

> You want 's/"\([A-Za-z]\)/``\1/g'.

Generally speaking, I'm a sed fan but it's not the right tool for the job
here if the quote can go over multiple lines. It's also hard (not
impossible) to keep track of whether you're inside or outside of the
quote; matters if you're using different replacements for the left and
right sides.

-- 
Angus

Reply via email to