#!/bin/bash #!/bin/bash # produces a crude HTML embedded SVG drawing from a tabular file (given on stdin) with columns separated by ":" # usage: tab2svg < inbut.txt > output.html awk $* -- ' BEGIN { FS=":" # field-separator: which character separats fields in a record (i.e. in a line) print "" print "" print " " print " SVG Data" print " " print " " } /^viewbox/ { x = $2 y = $3 w = $4 h = $5 } /^rect/ { if (h > 0) { printf " board = %dmm x %dmm\n

\n", $4, $5 printf " \n", $4, x, y, w, h h = 0 } printf " \n", $6, $2, $3, $4, $5 } /^polygon/ { printf " \n", $8, $2, $3, $4, $5, $6, $7 } END { print " " print " " print "" } '