Question: Use the library function fgets ( ) to get the header row. Use splitrow ( ) to break the header row into columns and determine
Use the library function fgets to get the header row.
Use splitrow to break the header row into columns and determine the correct number of columns in the input file.
Use setorder to check the arguments, and fill the output column offset table.
Use wrtrow to output the header row.
Set the rowcount to you just read the header row
Use fgets to get the next input row top of a loop until EOF.
a Count the number of rows input rowcount
b Use splitrow to break the row into columns.e
c Use wrtrow to output the selected columns in the specified order using the output column offset table.
d Count the number of rows not output in dropcount. Rows are not output dropped when either splitrow or wrtrow indicates through the return value that an error has occurred.
Write a summary of operation to stderr that says how many rows were input rowcount and how many rows were skipped dropcount due to an error with the row wrong number of columns or a write failure
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
