Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: One-liner to fix LaTeX quotation marks

by aitap (Deacon)
on Oct 14, 2012 at 19:48 UTC ( #998970=note: print w/ replies, xml ) Need Help??


in reply to One-liner to fix LaTeX quotation marks

cat file.txt | perl -pe 's/\"[^[\'\`]/"`/g'
but something is wrong, the shell wants more input.
This is because you can't really escape anything in single quotes in UNIX shell. You have to write the command like this:
$ perl -pe "s/\"([^'\`])/'\$1/g" This is "an example", but "`this not"'. This is 'an example', but "`this not"'.
Sorry if my advice was wrong.


Comment on Re: One-liner to fix LaTeX quotation marks
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998970]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-09-01 19:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (17 votes), past polls