command for converting 4 column data to 1 column

dear friends I want to convert four column data to one column data. For example:

from

1, 2, 3, 4
5, 6, 7, 8

to

1
2
3
4
5
6
7
8

what is the general command for that type of convertion.

thanks

sed 's/, /\n/g' file
1 Like
tr ',' '\n' < filename
1 Like
cat file.txt |tr  ',' '\n' | tr -d ' ' 
1 Like

Or even (getting rid of the space characters first):

sed -e "s/ //g" filename | tr ',' '\n'

The Perl way :smiley:

perl -pe 's/, /\n/g' filename