#!/bin/bash # produces an XML file from a tabular file (given on stdin) with columns separated by ":" # usage: tab2xml < inbut.txt > output.xml awk $* -- ' BEGIN { FS=":" # field-separator: which character separats fields in a record (i.e. in a line) print "" print "" } { print " " for (i = 1; i <= NF; i++) { print " "$i"" } print " " } END { print "
" } '