I have to create a report in the format below:
Input
Status id id1 id2 price qty error
-----------------------------------------------
aaa 1 1 1 100 10 inv-type man-err typ-err
bbb 2 2 2 50 5 typ-err new-err send-err man-err
-----------------------------------------------
aaa 1 1 1 100 10 inv-type man-err typ-err
bbb 2 2 2 50 5 typ-err new-err send-err man-err
output
Status id id1 id2 price qty error
-----------------------------------------------
aaa 1 1 1 100 10 inv-type
man-err
typ-err
<one blank line>
bbb 2 2 2 50 5 typ-err
new-err
send-err
man-err
-----------------------------------------------
aaa 1 1 1 100 10 inv-type
man-err
typ-err
<one blank line>
bbb 2 2 2 50 5 typ-err
new-err
send-err
man-err
The only difference in the output file is the error field has to be displayed column wise for each row, then one blank line
and same for all other records. There are spaces in between the errors, that needs to be removed and bring it to the next column from the input file.