libreoffice-calc

LibreOffice Calc count the number of distinct occurrences

自闭症网瘾萝莉.ら 提交于 2021-02-07 02:46:18
问题 What formula in LibreOffice Calc will count the number of distinct Week_Number occurrences? The answer should be 2. 回答1: This question has been asked many times before. One way is to enter the following formula in B6 and then press Ctrl + Shift + Enter : =SUM(1/COUNTIF(B2:B5,B2:B5)) Other solutions are described at: https://forum.openoffice.org/en/forum/viewtopic.php?f=9&t=47223 https://superuser.com/questions/238656/openoffice-get-distinct-values-from-column https://askubuntu.com/questions

Running Libreoffice BASIC macro from python

半腔热情 提交于 2021-01-29 00:17:41
问题 I've a macro in LibreOffice BASIC and I want to run it from my python program. I've found some threads in which they use this code: import os import win32com.client if os.path.exists("excelsheet.xlsm"): xl=win32com.client.Dispatch("Excel.Application") xl.Workbooks.Open(Filename="C:\Full Location\To\excelsheet.xlsm", ReadOnly=1) xl.Application.Run("excelsheet.xlsm!modulename.macroname") ## xl.Application.Save() # if you want to save then uncomment this line and change delete the ", ReadOnly=1"

Running Libreoffice BASIC macro from python

匆匆过客 提交于 2021-01-29 00:13:42
问题 I've a macro in LibreOffice BASIC and I want to run it from my python program. I've found some threads in which they use this code: import os import win32com.client if os.path.exists("excelsheet.xlsm"): xl=win32com.client.Dispatch("Excel.Application") xl.Workbooks.Open(Filename="C:\Full Location\To\excelsheet.xlsm", ReadOnly=1) xl.Application.Run("excelsheet.xlsm!modulename.macroname") ## xl.Application.Save() # if you want to save then uncomment this line and change delete the ", ReadOnly=1"

two-way ANCOVA: Analysis of Covariance in LibreOffice Calc

旧街凉风 提交于 2021-01-28 22:10:03
问题 Following this feature request, I want to know if/how I can have a macro to provide a simple GUI to do two-way ANCOVA (Analysis of Covariance) in Open/LibreOffice Calc. There is already an ANOVA tool in Calc, which does not comply with my understanding of the method (refrence): categorical dependent variable(s) and quantitative response as it seems to only accept continuous variables! So it is kind of an ANCOVA which only accepts covariants? I'm not really sure (example). Searching the

Using Python to access LibreOffice Calc using Uno

落花浮王杯 提交于 2020-12-12 11:34:02
问题 I'm trying to write a script to manipulate a Ubuntu Mint _LibreOffice Calc sheet using Python 3.7,. For some reason I'm getting an error when I try to import Uno. I can run a macro from inside Calc calling this desktop = XSCRIPTCONTEXT.getDesktop() model = desktop.getCurrentComponent() active_sheet = model.CurrentController.ActiveSheet write 'Hello World' in A1 active_sheet.getCellRangeByName("A1").String = "Hello World! " but can't directly from the VS_code IDE, interact with the sheet. Is

Using Python to access LibreOffice Calc using Uno

自古美人都是妖i 提交于 2020-12-12 11:32:29
问题 I'm trying to write a script to manipulate a Ubuntu Mint _LibreOffice Calc sheet using Python 3.7,. For some reason I'm getting an error when I try to import Uno. I can run a macro from inside Calc calling this desktop = XSCRIPTCONTEXT.getDesktop() model = desktop.getCurrentComponent() active_sheet = model.CurrentController.ActiveSheet write 'Hello World' in A1 active_sheet.getCellRangeByName("A1").String = "Hello World! " but can't directly from the VS_code IDE, interact with the sheet. Is

How to generate pdf from a libreoffice calc sheet fitting the page width?

南楼画角 提交于 2020-05-09 19:30:13
问题 Using LibreOffice 4.1.2.3 in Ubuntu 13.10 I am desperately trying to export the content of a sheet (4 columns) into a pdf (portrait), so all 4 columns fit on a page. A page nicely explains all the settings - but they do not have any effect! I select all the range I want to export to a pdf (the 4 columns previously mentioned), click File -> Export as PDF, and no matter what I change (e.g. zoom to 7%), the generated pdf contains two pages: One page with the first three columns, and another page

Err:508 in formula written with Openpyxl

时间秒杀一切 提交于 2020-04-30 11:20:10
问题 I have this script: from openpyxl import Workbook wb = Workbook() ws = wb.active ws['A1'] = 1 #any value ws['B1'] = 0 #any value ws['C1'] = 3 #any value ws['D1'] = 0 #any value ws['E1'] = "= IF(A1<>0;A1;1) * IF(B1<>0;B1;1) * IF(C1<>0;C1;1) * IF(D1<>0;D1;1)" wb.save('error.xlsx') When I open the file with LibreOffice Calc, I see Err:508 in E column: However, if I edit the formula in the command line, without changing nothing (i.e. add an space or erase any character and write the same again)

grouping a column of categorical variable into a set of unique values

一曲冷凌霜 提交于 2020-03-25 19:13:18
问题 Following this question, I want to know how I can specify a column/row of a specific sheet including a categorical variable, in Open/LibreOffice BASIC script/macro and get the unique list (i.e., set) of the values. For example, consider the below dataset: A, B, C 1. gender, age, height 2. man, 34, 180 3. woman, 23, 155 4. man, 54, 165 5. other, 37, 172 6. woman, 19, 169 Now I want to specify the column tag A or header gender in Sheet1 and get the unique values stored in an array woman, man,

How is a String marked as bold in a Libre Office flat XML (fods) file?

我是研究僧i 提交于 2020-02-16 10:40:09
问题 Looking at the raw XML from a .fods file: <table:table-column table:style-name="co1" table:default-cell-style-name="ce17"/> <table:table-row table:style-name="ro1"> <table:table-cell table:style-name="ce15" office:value-type="string" calcext:value-type="string"> <text:p>John Smith</text:p> </table:table-cell> </table:table-row> <table:table-row table:style-name="ro2"> <table:table-cell table:style-name="ce16" office:value-type="string" calcext:value-type="string"> <text:p>(123) 456-7890</text