Question
How to do this on the Linux console? The file is called music-collection.csv In this step, we want to find the top five albums by
How to do this on the Linux console? The file is called music-collection.csv
In this step, we want to find the top five albums by the number of tracks. Note that albums by two artists can have the same title (e.g. Greatest Hits). Use the cat, awk, sort and uniq -c command to get the title of all the albums (along with the artist name) with a count of the number of tracks in it. The album title is in the 2nd column and the artist's name is in the 1st column of the csv file. Then we can pipe the output to sort -rn and sed command to get the top five albums by the number of tracks. Format the output so each field is separated by a colon (this can be done with the print command in awk).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started