I want to write a C code, which should read a input text file and after doing some operation needs to write out a text file. Need to read lines that starts with letter A from some part of the inputfile and get 3 values from each line in the order. Also, needs to read the lines that starts with word DD and get 1 value from each line in the output file. Below is the input & output file format.
Input file is below
A, velo, 12.4567, 13.8745, 45.6789
A, velo, 45.2222, 1.3453, 0.0897
A, velo, 0.7867, 1567.4534, 122.5676
DD, ASD, 2345.0099
And ouput file should look like,
12.4567 13.8745 45.6789 2345.0099
45.2222 1.3453 0.0897 342.8970
0.7867 567.4534 122.5676 5542.8945
.ie, 3 values from lines that starts with letter A and 1 value from the lines that starts with DD. The Number of lines that starts with A and DD are same.
GREATLY APPRECIATE IF SOME BODY CAN SHARE A SAMPLE PROGRAM or give a start on how I can proceed.