0
I want to make a script with Shell script that extracts from a text file emoticons, for example ;)
, :)
, :3
, :(
, xD
and also count the emoticons of each sentence.
A sentence is declared positive if the sum of the positive emoticons exceeds 2.5 times the sum of the negative emoticons if present, I made that code that counts the amount of positive, please as I would finish that 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"
Almost that, I just wish there was a loop that reads line by line from a text file, and identifies whether that phrase is positive or negative.
– user35473