I have a string with some comma-separated values:
my_string = 'abc,kjj,hg,kj,ls,jsh,ku,lo,sasad,hh,da'
I need to split this string by every 5th occurrence of a comma.
Code I tried:
a = re.findall("\,".join(["[^,]+"] * 5), my_string)
Current output:
['abc,kjj,hg,kj,ls', 'jsh,ku,lo,sasad,hh']
Expected output:
['abc,kjj,hg,kj,ls', 'jsh,ku,lo,sasad,hh', 'da']
How to get remaining string?