ScriptForge (SF_Calc) new RemoveDuplicates() method

Desktop / LibreOffice - Jean-Pierre Ledure [ledure.be] - 21 January 2023 16:48 UTC

Remove duplicate values from a range of values.

The comparison between rows is done on a subset of the columns in the range. The resulting range replaces the input range, in which, either: all duplicate rows are cleared from their content all duplicate rows are suppressed and rows below are pushed upwards.

Anyway, the first copy of each set of duplicates is kept and the initial sequence is preserved.

Arguments of the method: Range: the range, as a string, from which the duplicate rows should be removed Columns: an array of column numbers to compare; items are in the interval [1 .. range width] Default = the first column in the range Header: when True, the first row is a header row. Default = False. CaseSensitive: for string comparisons. Default = False. Mode: either "CLEAR" or "COMPACT" (Default) For large ranges, the "COMPACT" mode is probably significantly slower.

The method has been implemented for Basic and Python user scripts.

The calc.xhp help page should be updated accordingly.

Change-Id: I352b2f3da98974d9482575850550cec4e27d2e01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145954

ac21a5ee9b51 ScriptForge (SF_Calc) new RemoveDuplicates() method
wizards/source/scriptforge/python/scriptforge.py | 3 +
wizards/source/sfdocuments/SF_Calc.xba | 126 +++++++++++++++++++++++
2 files changed, 129 insertions(+)

Upstream: cgit.freedesktop.org


  • Share