+1 714-215-3097

(Solved) : Write Program Average Columns Csv File Write C Program Parse Csv File Fields Separated Cha Q35542069

Write a program to average columns in a CSV file

Write a C program to parse a *.csv file where fields areseparated by the ‘;’ character and print out the average of eachcolumn (which is an integer), separated by the ‘;’ character.

Your executable file must be named avgcsv. It should take asargument the name of a csv file and outputs the average of eachcolumn, separated by ‘;’. You should print out the average to theprecision of 2 decimal points.

For example, suppose the contents of the example.csv are asfollows:

$ cat example.csv 10;25.5;5622;10;100.4

Then, the expected output of the command ./avgcsv example.csvshould be:

$ ./avgcsv example.csv16.00;17.75;78.20

We expect you to write a Makefile to generate the avgcsvexecutable file from your source code. Recitation 1 teaches you howto write a Makefile.

We do not provide you with any tests and will test your programunder a few csv files of our own choosing during grading time. Wehighly encourage you to write unit tests for your program.

Once finished, add relevant source files and Makefile to yourgit repo

Example of input files:



**Note: the existing chegg answer does not work

Leave a Reply

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