2 deleted 14 characters in body
source | link
cat > inputfile

X1 a1,b1,c1,d1.................. and so on upto ndn
X2 a2,b2,c2,d2.................. and so on upto n
................................................
................................................
Xn an,bn,cn,dn....................and so on upto n

output format:

X1 a1 +
   b1 +
   c1 +
   .
   .
   .
   .

X2 a2 +
   b2 +
   c2 +
   .
   .
   .


and so on

I am trying something like

 sed ':b;s/,/\
/;tb;s/\
/ +/g'

NOTE : I need to add a tab before b1 +,c1 +.... ,b2 +,c2 +,... etc

cat > inputfile

X1 a1,b1,c1,d1.................. and so on upto n
X2 a2,b2,c2,d2.................. and so on upto n
................................................
................................................
Xn an,bn,cn,dn....................and so on upto n

output format:

X1 a1 +
   b1 +
   c1 +
   .
   .
   .
   .

X2 a2 +
   b2 +
   c2 +
   .
   .
   .


and so on

I am trying something like

 sed ':b;s/,/\
/;tb;s/\
/ +/g'
cat > inputfile

X1 a1,b1,c1,d1.................. dn
X2 a2,b2,c2,d2.................. and so on upto n
................................................
................................................
Xn an,bn,cn,dn....................and so on upto n

output format:

X1 a1 +
   b1 +
   c1 +
   .
   .
   .
   .

X2 a2 +
   b2 +
   c2 +
   .
   .
   .


and so on

I am trying something like

 sed ':b;s/,/\
/;tb;s/\
/ +/g'

NOTE : I need to add a tab before b1 +,c1 +.... ,b2 +,c2 +,... etc

1
source | link

How can i change the format of text using sed?

cat > inputfile

X1 a1,b1,c1,d1.................. and so on upto n
X2 a2,b2,c2,d2.................. and so on upto n
................................................
................................................
Xn an,bn,cn,dn....................and so on upto n

output format:

X1 a1 +
   b1 +
   c1 +
   .
   .
   .
   .

X2 a2 +
   b2 +
   c2 +
   .
   .
   .


and so on

I am trying something like

 sed ':b;s/,/\
/;tb;s/\
/ +/g'