tim_the_monk has asked for the wisdom of the Perl Monks concerning the following question:
I would like to replace all double quotation marks (") in a text document which are not directly followed by the a ītick (') or a backtick (`) with ticks.
For example, the text
This is "an example", but "`this not"'.Should look like this afterwards:
This is 'an example', but "`this not"'.The background is LaTeX: I have a german document that contains proper german quotation marks (the 'this not' part above) as well as broken ones (the 'an example' part).
Does anybody know a Perl one-liner on the command line for this?
Thanks in advance,Tim
I triedbut something is wrong, the shell wants more input.cat file.txt | perl -pe 's/\"[^[\'\`]/"`/g'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: One-liner to fix LaTeX quotation marks
by LanX (Saint) on Oct 14, 2012 at 19:40 UTC | |
by tim_the_monk (Initiate) on Oct 14, 2012 at 19:56 UTC | |
|
Re: One-liner to fix LaTeX quotation marks
by aitap (Curate) on Oct 14, 2012 at 19:48 UTC | |
|
Re: One-liner to fix LaTeX quotation marks
by hippo (Archbishop) on Oct 14, 2012 at 22:59 UTC | |
|
Re: One-liner to fix LaTeX quotation marks
by CountZero (Bishop) on Oct 15, 2012 at 07:50 UTC | |
|
Re: One-liner to fix LaTeX quotation marks
by grizzley (Chaplain) on Oct 15, 2012 at 07:19 UTC |