CS253 – Assignment 2: Advanced Bash Scripting (Solution)

$ 24.99
Category:

Description

{
“A” : ”a”,
“B” : “b”,
“C” : “c”,
“D” : {
“d” : “4”
}
}
To retrieve the value “c” one way to get is: – jq “.C|values” <path_Of_The_JSON_File> –output c To retrieve the value “4” we get it like this: – jq “.D.d|values” <path_Of_The_JSON_File> –output 4

Task
Explore and access the downloaded covid_Data json file from within the solution shell file. Make a csv file named processed_Covid_Data_<your_Roll_Number>.csv.
with the format as shown,

<state>, <district>, <confirmed_Cases>, <recovery_Rate> where,
• state is the state code, example AN, KA etc.,
• district is the district name with maximum recovery rate,
• confirmed_Cases is the number of confirmed cases for this district name (district with max recovery rate),
• recovery_Rate is the recovery rate for this district name (district with max recovery rate).

Recovery rate is calculated as [(recovered/confirmed) * 100]

Note: Consider the following while performing the task:
• For every state code, consider districts with more than or equal to 5000 number of confirmed cases for processing, ignoring the rest.
• Avoid including the state code entry in csv, if the number of confirmed cases for all of its districts is less than 5000.

A csv file for a sample data on marks shown below,
—————————————————————————–
Name Marks_Sub_1 Marks_Sub_2
Preeti 25 31
Ravi 25 30
Ankit 24 31
—————————————————————————– looks like this,

Preeti,25,31
Ravi,25,30
Ankit,24,31

Final Submission
• Name your solution shell file as cs253_assign_2_<your_Roll_Number>.sh and place this and your generated processed_Covid_Data_<your_Roll_Number>.csv in the home folder of the unzipped cs253_assign_2.zip.
• Rename this unzipped folder as cs253_assign_2_<your_Roll_Number>.
• Tar zip the folder cs253_assign_2_<your_Roll_Number>.
• Please make sure the solution shell script, generated csv and the covid_data json file along with the previous contents of the assignment are there in cs253_assign_2_<your_Roll_Number>.zip before submission.
• Submit your zipped file on the submission site.

Reviews

There are no reviews yet.

Be the first to review “CS253 – Assignment 2: Advanced Bash Scripting (Solution)”

Your email address will not be published. Required fields are marked *