I have a huge SVG file that I filled with all the characters for a font. There are a lottt of characters and it'd take forever to manually copy each of them into its own file. Each character has all of its paths combined into a group, so if something could automatically put each group into its own SVG file, that would solve my problem. Any ideas? Thanks!
One option is to use a data set, treating each glyph as a record. see for instance: ( http://vector.tutsplus.com/tutorials/tools-tips/quick-tip-data-driven-graphics-using-illustrators-variables-panel/ ) which is decent rundown where the author makes a single document with variables and a dataset and creates 100 unique business cards.
A second option is to notice that SVG files are text files and can be edited by a text editor. Exactly how you go about breaking the file up is dependent on how it was made and stored. I made a quick svg file by typing an 'a' glyph and then a 'b' glyph separately, expanded them, and then saved as svg. The result is below. Note the two
If I remove one whole
Obviously this is pretty cumbersome, but it is amenable programmatic text editing (vbscript, php, applescript, grep, c etc)
I recently tried to put 26 glyphs on 26 artboards in Illustrator and export them separately. Turns out in Illustrator that's not possible with SVG; it only remembers the active artboard but keeps all of the art.
So, I just layered all of the glyphs on top of each other, hid all but one of them, and exported. Changed layer visibility and repeated.
I would imagine that an Illustrator script wouldn't be too hard here. Layer them all on one artboard, then run a script that would 1) hide all objects in the layer, 2) make the first group visible, 3) export as '1.svg', 4) hide active object, and then loop that for as many objects as you have.