#! /bin/sh

if [ $# -ne 1 ]; then
    echo "Usage: $0 filename.csv"
    exit 1
fi

cat $1 | awk '
    
    BEGIN {
	print "<table rend=\"jjjjjjjjjjjjjjjjjjjj\">\n"
    } 

    END {
	print "</table>\n"
    } 

    {
	printf "<row><cell>"; print $0; printf "</cell></row>\n"
    }' \
    | sed -e 's/\\,/\&comma;/g' \
    | sed -e 's/,/<\/cell><cell>/g' \
    | sed -e 's/\&comma;/,/g' \
    > `dirname $1`/`basename $1 .csv`.tei

