Convert comma separated items into new line

[root@test]# cat input
a,b,c,d
[root@test]# cat input | sed 's/','/\n/g'
a
b
c
d
[root@test]# cat input | awk '$1=$1' RS=, OFS="\n"
a
b
c
d
[root@test]# cat input | tr -s ',' '\n'
a
b
c
d

Enjoy πŸ™‚

Advertisements

One thought on “Convert comma separated items into new line

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s