Hello Make Team,
I built an automation to add my emails into our notion account. Now i would love to remove a certain Email Signatur that repeats itself in various emails. In Python i would do it like this:
def remove_repeating_paragraph(text, paragraph):
Split the text into paragraphs (assuming paragraphs are separated by blank lines).
paragraphs = text.split(β\n\nβ)
Iterate through the paragraphs and remove the specified paragraph if found.
new_paragraphs = [p for p in paragraphs if p != paragraph]
Rejoin the remaining paragraphs to create the edited text.
edited_text = β\n\nβ.join(new_paragraphs)
return edited_text
Sample text
text = ββ"This is a sample text.
This is the paragraph to be removed.
Another paragraph here.
This is the paragraph to be removed.
Yet another paragraph at the end.ββ"
The paragraph to be removed
to_remove_paragraph = βThis is the paragraph to be removed.β
edited_text = remove_repeating_paragraph(text, to_remove_paragraph)
print(edited_text)
Is there any way to remove a certain text from the output of a text praser that repeats itself?
Thank you so much for any help in advance.