How to add "\n" after a certain number of delimiters in python?
For example, the data can be in this form. string = "1|2|Hello people|3 1|4|It can be a sentence too|8"
How to add "\n" after, let's say, 3 delimiters ("|")?
The output should be something like this. "1|2|Hello people|3", "1|4|It can be a sentence too|8"
I know I should use re.split, but I'm not too sure how to do it. Can someone help me please? Thanks in advance!