theG

The best way to become acquainted with a subject is to write a book about it………..wp

Menu

Skip to content
  • Home
  • About
  • Article
  • cPanel commandline
  • cPanel Migration
  • Exim & Spamming
  • GlusterFS
  • High availability
  • Linux
  • MySQL
  • MySQL Master-Master replication
  • MySql Replication Errors
  • Scripts
  • Temp
  • WordPress

Tag Archives: sed

Convert comma separated items into new line

December 21, 2017 by gopukrish

1

[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 🙂

Posted in bash, Centos, console, Linux, linux commandline. Tagged awk, commandline, linux, script, sed

Post navigation

January 2021
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
« Mar    
Create a free website or blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy