#!/bin/csh

# creates a simple *.txt file for each *.wav file by table 
# lookup in English_target_words_220.tab

cd  corpus

foreach w ( *.wav )
  echo "Creating $w:r.txt"
  set item = `echo $w:r | sed 's/^.*\(item....\)/\1/'`
  grep "^${item}" ../English_target_words_220.tab | cut -f 2 > ${w:r}.txt
end

exit 0
