I have a file (comma separated) on a Linux system with 3 columns. I want to start new column after every 4th row.
Input:
col1,col2,col3
1,disease1,high
1,disease2,low
1,disease3,high
col1,col2,col3
2,disease1,low
2,disease2,low
2,disease3,high
col1,col2,col3
3,disease1,low
3,disease2,low
3,disease3,low
Expected output:
col1,col2,col3,col1,col2,col3,col1,col2,col3
1,disease1,high,2,disease1,low,3,disease1,low
1,disease2,low,2,disease2,low,3,disease2,low
1,disease3,high,2,disease3,high,disease3,low
i.e. I want exactly 4 lines of output, each line is the result of joining every fourth line of the input with a comma.