1
0
mirror of https://github.com/balkian/bitter.git synced 2024-12-22 16:38:13 +00:00
bitter/bin/print-rts.sh

16 lines
374 B
Bash
Raw Normal View History

2018-03-19 13:35:07 +00:00
MAX_TAGS=100
function get_text {
while read line
do
echo $line
rtid=$(echo $line | awk '{print $2}')
count=$(echo $line | awk '{print $1}')
text=$(grep -m 1 $rtid *.text.csv)
echo "$line - $text"
done < "/dev/stdin"
}
cat "$@" | awk -F"," '{print tolower($2)}' | sort | uniq -c | sort -h | tail -n $MAX_TAGS | get_text