SEP=%%
if [ -z $1 ]
then
echo "Usage: `basename $0` csv-file db-title"
exit
fi
if [ -z $2 ]
then
echo "Usage: `basename $0` csv-file db-title"
exit
fi
ifo_file=$1.ifo
echo '# Database informations' > $ifo_file
echo 'type "db"' >> $ifo_file
echo title \"$2\" >> $ifo_file
for X in $( head -n 1 $1 | tr ' ' '_' | tr ',' '\n')
do
echo field \"$X\" string>> $ifo_file
done
echo 'option backup true
# CSV informations
extended off
format time "%H:%M"
format date "%Y/%m/%d"'>> $ifo_file
echo csvfile "$1">>$ifo_file
echo '# PDB informations
pdbpath ""'>>$ifo_file
clear
cat $ifo_file
csv2pdb --info="$ifo_file" --separator='%%' "$1" "$2".pdb
rm $ifo_file
exit