Raw Input
1,2,3,4,5,6,7,8,9,0
Desired Output
1,2,3
4,5,6
7,8,9
0
Script and Comments
Script1 [sed]
[ 1] s/\(\(,[^,]*\)\{2\}\),/\1\n/g
Script2 [perl]
[ 1] $string = '1,2,3,4,5,6,7,8,9,0';
[ 2] $string =~ s/((,[^,]*){2}),/$1\n/g;