Skip to content

Instantly share code, notes, and snippets.

@TerrenceSun
TerrenceSun / inkscape_label_to_id.pl
Last active January 9, 2023 18:19
This file read file of 'Plain SVG' type and change id with the same value of inkscape:label. The reason of making this script is that some application only read the id attribute, and it needs the value of id following some specified format. Manually way of doing this is to open the 'XML Editor', and type in the id with value you want.
#!/usr/bin/env perl
use strict;
my ($id, $label);
my @all_lines;
my %mapping;
while(<>) {
push @all_lines, $_;
if (/^\s*</) {
$id = undef;
$label = undef;