#!/bin/sh

FILENAME=`basename "$1" .txt`

echo $FILENAME | awk \
'BEGIN	{ FS = " - " }
	{
#        print "PERFORMER \""$1"\""
        print "TITLE \""$1" - "$2"\""
        print "FILE \""$1" - "$2".mp3\" MP3"
	}' > $FILENAME.cue

awk \
'BEGIN	{ FS = " - " }
	{
        print "  TRACK "$2" AUDIO"
        print "    TITLE \""$4"\""
	print "    PERFORMER \""$3"\""
        print "    INDEX 01 "$1":00"
	}' "$1" >> $FILENAME.cue
