Hi Friends ,
I am having one problem as stated file .
Having an input CSV file as shown in the code
U_TOP_LOGIC/U_HPB2/U_HBRIDGE2/i_core/i_paddr_reg_2_/Q,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0
U_TOP_LOGIC/U_HPB2/U_HBRIDGE2/i_core/i_paddr_reg_4_/Q,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,0
U_TOP_LOGIC/U_HPB2/U_HBRIDGE2/i_core/i_paddr_reg_5_/Q,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0
U_TOP_LOGIC/U_HPB2/U_HBRIDGE2/i_core/i_paddr_reg_3_/Q,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0
I need to find the number of times "1" occurs in each line and it should go as the last column in each line
Similarly I need to find the number of times "0" occurs in each line and it should go as the last column in each line
I need to create the average of [ number of times "1" occurs / number of "1" or "0" occurs] in each line
I need to create the average of [ number of times "0" occurs / number of "1" or "0" occurs] in each line
Output file should be something like this
U_TOP_LOGIC/U_HPB2/U_HBRIDGE2/i_core/i_paddr_reg_2_/Q,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,{Number of 1 occurence}, {Number of 0 occurence} , {Number of 1 / Number of 1 and 0 } , {Number of 0 / Number of 1 and Number of 0}
U_TOP_LOGIC/U_HPB2/U_HBRIDGE2/i_core/i_paddr_reg_4_/Q,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,0,{Number of 1 occurrence}, {Number of 0 occurrence} , {Number of 1 / Number of 1 and 0 } , {Number of 0 / Number of 1 and Number of 0}
U_TOP_LOGIC/U_HPB2/U_HBRIDGE2/i_core/i_paddr_reg_5_/Q,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,{Number of 1 occurrence}, {Number of 0 occurrence} , {Number of 1 / Number of 1 and 0 } , {Number of 0 / Number of 1 and Number of 0}
U_TOP_LOGIC/U_HPB2/U_HBRIDGE2/i_core/i_paddr_reg_3_/Q,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,{Number of 1 occurrence}, {Number of 0 occurrence} , {Number of 1 / Number of 1 and 0 } , {Number of 0 / Number of 1 and Number of 0}
Could you help me out ?
Thanks
Kshitij