Skip to main content
added 119 characters in body
Source Link
Wrzlprmft
  • 15k
  • 5
  • 61
  • 95

If you look into the source of your SVG (open it with a text editor), you will find mainly stuff like this:

<rect
   style="opacity:0.57009343;color:#000000;fill:#3f3790"
   id="rect2996"
   width="10.714286"
   height="52.857143"
   x="282.85715"
   y="155.16518"
   transform="translate(242.40625,114.78125)" />

Those lines starting with x= and y= contain exactly what you are looking for. You can now write some script to extract them, e.g., with an Inkscape-saved SVG the following works for me (for other SVGs you might need some adjustment):

grep " x=\"\| y=\"" drawing.svg | sed "s/[^\"]*\"//;s/\".*//" | paste -d '\t' - -

Note that the above may not work if the objects belong to a transformed group or are otherwise special.

If you look into the source of your SVG (open it with a text editor), you will stuff like this:

<rect
   style="opacity:0.57009343;color:#000000;fill:#3f3790"
   id="rect2996"
   width="10.714286"
   height="52.857143"
   x="282.85715"
   y="155.16518"
   transform="translate(242.40625,114.78125)" />

Those lines starting with x= and y= contain exactly what you are looking for. You can now write some script to extract them, e.g., with an Inkscape-saved SVG the following works for me (for other SVGs you might need some adjustment):

grep " x=\"\| y=\"" drawing.svg | sed "s/[^\"]*\"//;s/\".*//" | paste -d '\t' - -

If you look into the source of your SVG (open it with a text editor), you will find mainly stuff like this:

<rect
   style="opacity:0.57009343;color:#000000;fill:#3f3790"
   id="rect2996"
   width="10.714286"
   height="52.857143"
   x="282.85715"
   y="155.16518"
   transform="translate(242.40625,114.78125)" />

Those lines starting with x= and y= contain exactly what you are looking for. You can now write some script to extract them, e.g., with an Inkscape-saved SVG the following works for me (for other SVGs you might need some adjustment):

grep " x=\"\| y=\"" drawing.svg | sed "s/[^\"]*\"//;s/\".*//" | paste -d '\t' - -

Note that the above may not work if the objects belong to a transformed group or are otherwise special.

Source Link
Wrzlprmft
  • 15k
  • 5
  • 61
  • 95

If you look into the source of your SVG (open it with a text editor), you will stuff like this:

<rect
   style="opacity:0.57009343;color:#000000;fill:#3f3790"
   id="rect2996"
   width="10.714286"
   height="52.857143"
   x="282.85715"
   y="155.16518"
   transform="translate(242.40625,114.78125)" />

Those lines starting with x= and y= contain exactly what you are looking for. You can now write some script to extract them, e.g., with an Inkscape-saved SVG the following works for me (for other SVGs you might need some adjustment):

grep " x=\"\| y=\"" drawing.svg | sed "s/[^\"]*\"//;s/\".*//" | paste -d '\t' - -