Code:
$
$
$ cat f48
col1,col2,col3,CODE_0, ... , colN
col1,col2,col3,CODE_0, ... , colN
col1,col2,col3,CODE_1, ... , colN
col1,col2,col3,CODE_1, ... , colN
col1,col2,col3,CODE_1, ... , colN
col1,col2,col3,CODE_2, ... , colN
col1,col2,col3,CODE_2, ... , colN
col1,col2,col3,CODE_N, ... , colN
col1,col2,col3,CODE_N, ... , colN
col1,col2,col3,CODE_N, ... , colN
$
$ perl -F, -lane 'print "-"x40 if defined $prev and $F[3] ne $prev; print $_; $prev=$F[3]' f48
col1,col2,col3,CODE_0, ... , colN
col1,col2,col3,CODE_0, ... , colN
----------------------------------------
col1,col2,col3,CODE_1, ... , colN
col1,col2,col3,CODE_1, ... , colN
col1,col2,col3,CODE_1, ... , colN
----------------------------------------
col1,col2,col3,CODE_2, ... , colN
col1,col2,col3,CODE_2, ... , colN
----------------------------------------
col1,col2,col3,CODE_N, ... , colN
col1,col2,col3,CODE_N, ... , colN
col1,col2,col3,CODE_N, ... , colN
$
$