I writing a ksh shell script and I have long comma separated string that I need to divide into separate lines only after the 9th comma. After the 9th comma, I want to remove that comma and make a new line:
For Example:
Initial String
1,2,3,4,5,6,7,8,9,10,11,12,13,14,14,15,16,17,18,19,20,21
Output:
1,2,3,4,5,6,7,8,9,10
11,12,13,14,14,15,16,17,18,19,20
21
I know this is possible with awk but I am not so familiar with command. Can someone please provide how to do this
Thanks
1 Answer