I have a set of svg images that I would like to modify with a bash script. In particular, I would like to remove specific paths from the image by preserving the others. This is a working example:
<path
id="rect5505"
d="M 118.34375,20 C ... z"
style="fill:#4d8ecb;stroke:none;fill-opacity:1" />
<path
style="fill:#000000;fill-opacity:0.23529412;stroke:none;display:inline"
d="m ... z"
id="path17954"
sodipodi:nodetypes="ssccccccccccccssccccccs" />
In this case, there are two path
elements, but I would like to remove only the one that has fill:#000000;fill-opacity:0.23529412
. I know that I can use sed
in order to identify the line that has these fields, but how can I remove the whole path
field?
I would like to underline that this issue is not a duplicate of Add/remove xml tags using a bash script, since in that case there was a single field type. By using something like
sed -i '/<path/,/<\/>/d' image.svg
I would remove every single path in the file, isn't it?