Rajeshwari-Rudra / rr-wrangle

Demo on data wrangling using Bash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rr-wrangle

Demo on data wrangling using Bash

Assigned play

  • The Tragedy of Coriolanus by "Shakespeare"
http://shakespeare.mit.edu/coriolanus/full.html

I have choosen two speakers to retrive the data, they are named as follows :-

  • Speaker 1 :- BRUTUS
  • Speaker 2 :- CORIOLANUS

Bash Commands

  • curl command to fetch the data
curl "http://shakespeare.mit.edu/coriolanus/full.html" -O > input.txt
  • To count the number of times 'BRUTUS'
grep -i 'BRUTUS' input.txt -c
  • To calculate the number of words "CORIOLANUS"
grep -i 'CORIOLANUS' input.txt -c
  • Total number of words calculated for both 'BRUTUS' and 'CORIOLANUS'
$ eval "$(paste -d+ <(sed 's/\(.*\)/echo $((\1/' brutusCount.txt) <(sed 's/\(.*\)/\1))/' coriolanusCount.txt))"

Files

Resources

About

Demo on data wrangling using Bash


Languages

Language:HTML 100.0%