I have a file roll.txt
with below data in comma delimited format without any newline.
'123456789','987651234','129873645','213456789','987612345','543216789','432156789','876543291','213465789','542637819','123456','23456','22234','3456','7890543','34567891,'2345','567'
I need to insert a New Line after every 6th occurrence of the comma delimiter along with no comma at the end of each line.
Below is the expected output:
'123456789','987651234','129873645','213456789','987612345','543216789'
'432156789','876543291','213465789','542637819','123456','23456'
'22234','3456','7890543','34567891,'2345','567'
I am using below sed
command which is not working.
sed 's/[^,]//g'
\n
with a backslash followed by an actual newline, this would even be POSIX compliant, so the answer is not limited to GNUsed
anymore. – Philippos Oct 17 '23 at 10:01