mardi 5 septembre 2017

Replace text in one line but avoid certain pattern

I am trying to use sedfor replacing text in one line but only if it is not inside a specific pattern. For instance the line could be

bla blab blab \cite{bla} \cite[prout]{bla} \footcite[prout][hein]{ bla } Bla aBla

and the result must be (by replacing bla by KUI with unsensitive case)

KUI blab blab \cite{bla} \cite[prout]{bla} \footcite[prout][hein]{ bla } KUI aBla

I am not sure sed is the right command for this. Other classical unix command could be used.

Aucun commentaire:

Enregistrer un commentaire