Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version


If I'm right your are in writer and you want to replace the 1st, 3rd, 5th … paragraph-break by tab's?
I was not able to handle this by standard-find&replace nor alternate-find&replace -extension.

So I wrote down a quick python-solution, which works here with writer:

import re 
rex = re.compile(r'(.*?)\n(.*?)\n')

def tab_uneven_paras():
    doc = XSCRIPTCONTEXT.getDocument()
    doc.Text.String = rex.sub( r'\1\t\2\r', doc.Text.String)