User:Silviolorusso/Mixsvg: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
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]] </br>
[[File:mix1.svg]] <br/>
[[File:mix2.jpg]] </br>
<br/>
[[File:mix3.jpg]] </br>
[[File:mix2.svg]] <br/>
<br/>
[[File:mix3.svg]] <br/>

Latest revision as of 17:56, 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/

Mix1.svg

Mix2.svg

Mix3.svg