[Python,Calc] Group_Concat for the spreadsheet

Shared Libraries
Forum rules
For sharing working examples of macros / scripts. These can be in any script language supported by OpenOffice.org [Basic, Python, Netbean] or as source code files in Java or C# even - but requires the actual source code listing. This section is not for asking questions about writing your own macros.
Post Reply
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

[Python,Calc] Group_Concat for the spreadsheet

Post by Villeroy »

A most simple draft for an SQL GROUP_CONCAT function as found in many database engines (e.g. HSQLDB 2.x and MySQL).
Select a range of cells so the main category is found in the first column and the subcategories to be concatenated are found in the last column of the selection.
Run the macro.
The 2-column output will be dumped 2 rows below the selection.
Download and save the Writer document to a trusted directory. It contains a Basic installer for the Python script.
Attachments
Group_Concat.py.odt
(25.26 KiB) Downloaded 232 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply