Re: Suppression de texte dans un fichier
On 2005-07-11 16:17:24 +0200, Sébastien GALLET wrote:
> Le texte à supprimer dans le fichier est le suivant
>
> <dictionary id="german">
> <element title="Deutsch" language="DE"/>
> <element title="German" language="EN"/>
> <element debug="false"/>
> <execute cmd="ispell -ddeutsch -a -P -H -Tlatin1"/>
> </dictionary>
>
> et pour faciliter la chose, il peut il y avoir un nombre quelconque de
> ligne du style <element title="German" language="EN"/>.
> Bref tout ce qu'il y a entre <dictionary id="german"> et </dictionary>
Si c'est un fichier XML, tu peux utiliser XMLStarlet.
Un truc du genre:
xmlstarlet ed -d "//dictionary[@id='german']" fichier.xml
--
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
Reply to: