Assignment Task
For this assignment, you will use the features of bash scripting. You are given a block file format and you need to convert it to a CSV format, and then sum some columns. The format is as follows: Each block represents 1 row in the table each block starts with \”{\” and ends with \”}\”Each column is represented as a comma-separated pair on its own line within the block. For example \”height,5\” on its own line represents a column height, with a value of 5 in that row. The blocks do not have to contain the same columns. If a block has one column, and another block does not. The block lacking that column has an assumed value of \”0\” for that column. Example block:{name, Otus Reddingheight,6}{name, Bill Darlingweight,70}In the above example there are two rows and 3 columns. The first block has values in the column name and height, and the second block has values in name and weight. height, name, weight, Otus Redding,00, Bill Darling,70The above block would represent the tableWrite a script called script7.sh that accepts 2 parameters:$1, is the filename of the block formatXX, is a regex pattern that is to meant to match column names you script will take the block formatted file and convert it to a csv file, as shown above. The column names should be in alphabetical order. Add an additional column to the table called result which sums up all the values in columns that match XX in a given row. For the example invocation:./script7.sh exampleTable.csv \”.eight\”Should write stdoutheight, name,weight, result, Otus Redding,0,60, Bill Darling,70,70Do not use awk, functions, declare you can use loops and grep sed and basic command to modify columns and rowsmake sure you test it using command python3 test_a7.pyIt should pass all 5 test as it is supposed to match the expected output in files given. imma, provide you my code it passes 4 test which matches first 4 expected output files but doesn\’t match 5th file. So, 80% work is already done.
