I want to make a script with a shell script that extracts from an emoticons text file, for example ;)
, :)
, :3
, :(
, xD
and also count the emoticons of each sentence.
A statement is declared positive if the sum of the positive emoticons exceeds 2.5 times the sum of the negative emoticons if present, I made this code that counts the amount of positive, please how would I end this script?
#!/usr/bin/ksh
file="${1}"
while IFS= read -r line
x=0
do
let "x=x+1"
qtd=$(echo "$line" | sed -r 's/ /\n/g' | grep "POSITIVO" | wc -l)
echo "SENTENÇA $x \t - POSITIVO - $qtd"
done <"$file"