Quantcast
Channel: Apache OpenOffice Community Forum
Viewing all articles
Browse latest Browse all 1281

Macros and UNO API • Re: Retrieve a specific number of lines with TextInputStream

$
0
0
Hallo

Code:

def main(*_):    doc = XSCRIPTCONTEXT.getDocument()    skip, read = 3,  5    output_range = doc.Sheets[0][:read, 0]        with open("ali.txt") as ali:        for _ in range(skip-1):            next(ali)        out = [[next(ali).strip()] for _ in range(read)]    output_range.DataArray = out

Statistics: Posted by karolus — Sun Jan 19, 2025 9:10 pm



Viewing all articles
Browse latest Browse all 1281

Trending Articles