Topic on Manual talk:Pywikibot

Deleting blank lines with replace.py inside templates

6
Theklan (talkcontribs)

Hello! I have been using replace.py to delete obsolete lines inside templates, but now I have some empty lines. I can't find a way to delete them... can someone help with this? Thanks!

Matěj Suchánek (talkcontribs)

Please share more information: What is your regex, what does your input look like, what do you expect?

Theklan (talkcontribs)
Matěj Suchánek (talkcontribs)

Don't you want to replace it with a single newline \n? The problem I can see is that there were some spaces between the newlines, which you can fix with \n *\n *\n.

Theklan (talkcontribs)

Thanks for the clue! Is there any other script to delete blank lines only inside templates?

Matěj Suchánek (talkcontribs)

None that I know.

Reply to "Deleting blank lines with replace.py inside templates"