Skip to content

Commit

Permalink
Add CL script
Browse files Browse the repository at this point in the history
  • Loading branch information
ortal28 authored Dec 7, 2023
1 parent 534116e commit 971ae7b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CommandLine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
awk -F, '$3 != 0 {print $4}' vodclickstream_uk_movies_03.csv | sort | uniq -c| sort -nr| head -n 1
seconds=$(awk -F, '{sum+=$3} END {print sum/NR}' vodclickstream_uk_movies_03.csv)
echo "The average time between subsequent clicks on Netflix.com in seconds is: $seconds"
user=$(awk -F, '{sum[$NF]+=$3} END {max=0; for (i in sum) if (sum[i]>max) {max=sum[i]; max_id=i} print max_id}' vodclickstream_uk_movies_03.csv)
echo "The ID of the user that has spent the most time on Netflix is: $user"

0 comments on commit 971ae7b

Please sign in to comment.