I've got a SVG file of the map of the US and I want to add colors to it. Because it would take me to much time, I thought I could use a bash script. I have also another file containing the states and the colors that belong to them.
SVG-file:
<g id="hi">
<title>Hawaii</title>
<path class="state hi" d="m 233.08751,519.30948 ... z" id="HI" />
</g>
CSV-file
HI, blue
What I want:
<g id="hi" style="fill:blue;">
<title>Hawaii</title>
<path class="state hi" d="m 233.08751,519.30948 ... z" id="HI" />
</g>
I thought I could use grep
or sed
but I really don't know where to begin.