<< Back to Map Development Forum   Search

Posts 1 - 9 of 9   
Remove all territory ID's: 1/27/2012 18:30:12


Moros 
Level 50
Report
I found a map svg, that was practically ready to be launched. I just thought it would be cool to keep on my computer for when I didn't knew any more maps to make. Because of the large number of territories I tried Matma Rex's ID-generator tool. But it didn't work because all territories already had an ID (they were all named polygon_#). I guess that's because they were polygons first, until I transferred them to paths. But is there a way to remove all ID's so Matma's tool can work on it?
Remove all territory ID's: 1/27/2012 19:00:13

bloodnok
Level 10
Report
SVG is a human-readable format; if you have access to a machine you can run Perl on, a simple Perl script would strip them all out.

< oldfile.svg perl -nwe 's/\s*id=\"polygon_\d+\"\s*\n//; print;' > newfile.svg

or something like that.
Remove all territory ID's: 1/27/2012 19:15:42


Moros 
Level 50
Report
I don't know anything about scripting.
Remove all territory ID's: 1/27/2012 19:39:07

Segrain
Level 21
Report
If I understood it right, you have a lot of objects with IDs of **polygon_#** and you want to remove those IDs to be able to give them proper IDs of **Territory_#**. If it's true, just open SVG file with your favorite text editor and use "replace all" (or any similar function) to replace all **polygon_** in a file by **Territory_**, and you wouldn't even need to use the generator.
Remove all territory ID's: 1/28/2012 00:26:53


Moros 
Level 50
Report
What kind of editor are you talking about? Something like Word? I don't think that can open svg files...
Remove all territory ID's: 1/28/2012 03:58:29

Zibem
Level 3
Report
You can open an SVG in Notepad, actually.
Remove all territory ID's: 1/28/2012 11:07:21


Moros 
Level 50
Report
Okay, I did as you said, but now it has turned into a txt file and Inkscape can't open it!
Remove all territory ID's: 1/28/2012 11:15:05

Segrain
Level 21
Report
I guess you did it with something like Notepad and accidentally saved your file as *filename***.txt**. Try to manually rename it to *filename***.svg**.
Remove all territory ID's: 1/28/2012 11:43:58

Grzechooo 
Level 30
Report
This is the power of SVG: simple text file, and I suggest to get some cool text editor, I can recommend [Notepad++](http://notepad-plus-plus.org/).
Posts 1 - 9 of 9