I have a string of huge characters repeating a character set. Line:qwethisistheimportantpartqwethisisthesecondimportantpart
There are no spaces in the line. I want to add a new line before the qwe line so that I can distinguish each important part from the other.
Output:
qwethisistheimportantpart
qwethisisthesecondimportantpart
I tried to use
for line in infile:
if line.startswith("qwe"):
line="\n" + line
and doesn't seem to work
Rahul source
share