Input file:
Total_counts 1306726155 100%
Number_of_count_true 855020282
Number_of_count_true_1 160014283
Number_of_count_true_2 44002825
Number_of_count_true_3 18098424
Number_of_count_true_4 24693745
Number_of_count_false 115421870
Number_of_count_true 51048447
Total_number_of_false
Desired output file:
Total_counts 1306726155 100%
Number_of_count_true 855020282 65.43%
Number_of_count_true_1 160014283 12.25%
Number_of_count_true_2 44002825 3.37%
Number_of_count_true_3 18098424 1.39%
Number_of_count_true_4 24693745 1.89%
Number_of_count_false 115421870 8.83%
Number_of_count_true 51048447 3.91%
Total_number_of_false 1191304285 91.17%
Condition:
-
All those column 2 that matched "Number_of_count" is divided with the column 2 in "Total_counts" and multiple 100% to generate the figure in column 3;
eg. 855020282/1306726155*100%=65.43% -
Column 2 of "Total_number_of_false" is generated based on minus of column 2 in "Total_counts" with column 2 in "Number_of_count_false";
eg. 1306726155-51048447=1191304285 -
Column 3 of "Total_number_of_false" is generated based on minus of column 3 in "Total_counts" with column 3 in "Number_of_count_false";
eg. 100%-8.83%=91.17%
Thanks for any advice.