Code:
[ctsgnb@shell ~]$ cat input
Col1,Col2|Col3,Col4|Col5,Col6|Col7,Col8
Market1,"Chain1"|3,3|3,3|3,3|3,3
Market1,"Chain1"|3,3|||
Market1,"Chain1"||3,3||
Market1,"Chain1"|||3,3|
Market1,"Chain1"||||3,3
[ctsgnb@shell ~]$ sed "s/||/,,,/;s/||/,,,/;s/|/,/g;s/,$/,,/" input <------- i tried the anbu23 proposal
Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8
Market1,"Chain1",3,3,3,3,3,3,3,3
Market1,"Chain1",3,3,,,,,
Market1,"Chain1",,,3,3,,,,
Market1,"Chain1",,,,3,3,,
Market1,"Chain1",,,,,,3,3
[ctsgnb@shell ~]$ sed 's/||/|,|/g;s/|$/,,/;s/|/,/g' input <---- you can get exactly the same output with 1 less substitution
Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8
Market1,"Chain1",3,3,3,3,3,3,3,3
Market1,"Chain1",3,3,,,,,
Market1,"Chain1",,,3,3,,,,
Market1,"Chain1",,,,3,3,,
Market1,"Chain1",,,,,,3,3