Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Bash Script via VIM In a file called votingOptions , write a bash script that lo

ID: 3913355 • Letter: B

Question

Bash Script via VIM
In a file called votingOptions, write a bash script that looks at the 2012_GENERAL.txt (see below) file in the directory and prints the total unique number of candidate names in the file. Consider anything in the NAME column a candidate name.
The provided file is tab separated, meaning that visually, lines may not appear aligned, but the content is aligned with one tab in between each column.

Note: Easiest way to split tab separated files in bash. Look at the cut command with the -f flag.

2012_GENERAL.txt file
https://www.dropbox.com/s/n5kvxb3ead1l7en/2012_GENERAL.txt?dl=0

Explanation / Answer

use the following two commands to get the desired output


awk '{print $5}' 2012_GENERAL.txt >output.txt

sort -u output.txt