User:Silviolorusso/Mixsvg: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with "A little script to mix two .svg files in one. Still not completely working. <source lang="bash"> #!/bin/sh # a simple script to mix two .svg in one. # Usage: command <file1> <...")
 
No edit summary
Line 30: Line 30:
Examples with Clip arts taken from http://www.openclipart.org/
Examples with Clip arts taken from http://www.openclipart.org/


[[File:mix1.jpg]]
[[File:mix1.jpg]] </br>
[[File:mix2.jpg]]
[[File:mix2.jpg]] </br>
[[File:mix3.jpg]]
[[File:mix3.jpg]] </br>

Revision as of 18:54, 16 October 2011

A little script to mix two .svg files in one. Still not completely working.

 
#!/bin/sh

# a simple script to mix two .svg in one.
# Usage: command <file1> <file2>

cat $1 > temp.svg

# remove conflicting tags
awk 'match($0,"<svg") == 0 {print $0}' $2 > info 
awk 'match($0,"<?xml") == 0 {print $0}' info > info2
awk 'match($0,"<!DOCTYPE") == 0 {print $0}' info2 > info3


awk 'match($0,"</svg>") == 0 {print $0}' temp.svg > mix.svg

# appending second svg after first one
cat info3 >> mix.svg


# remove temporary files
rm info
rm info2
rm info3
rm temp.svg

Examples with Clip arts taken from http://www.openclipart.org/

File:Mix1.jpg
File:Mix2.jpg
File:Mix3.jpg