Saturday, April 4, 2009

unix script replace comma with comma follwoed by New line

cat input.txt sed 's/\,/\,\n/g'>output.txt

input.txt
a,b,c,d
output.txt

2 comments:

  1. (1)csed 's/\,/\(\)\,/g'

    will replace , - > (),

    (2)sed 's/\,/\(\)\,\n/g'
    will replace , - > (), < and a new line insert>

    ReplyDelete