CellColumnRedaction class

CellColumnRedaction class

Represents a text redaction that replaces text in spreadsheet documents (CSV, Excel, etc.).

Learn more

The CellColumnRedaction type exposes the following members:

Constructors

Constructor Description
init Initializes a new CellColumnRedaction.

Methods

Method Description
apply_to Applies the redaction to a given format instance.

Properties

Property Description
description The description of the redaction, containing the redaction name and parameters.
filter The column and worksheet filter.
pattern The regular expression to match.
action_options The ReplacementOptions instance specifying the type of text replacement. (inherited from TextRedaction)
ocr_connector The OCR connector implementation used to extract text from graphic content. (inherited from TextRedaction)

Example

from groupdocs.redaction import Redactor
from groupdocs.redaction.redactions import CellColumnRedaction, ReplacementOptions
from groupdocs.redaction.redactions import CellFilter

with Redactor("sales.xlsx") as redactor:
    filter = CellFilter()
    filter.column_index = 1  # zero-based second column
    filter.work_sheet_name = "Customers"

    expression = r"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"
    change_log = redactor.apply(
        CellColumnRedaction(filter, expression, ReplacementOptions("[customer email]"))
    )
    # Optionally inspect change_log.status
    redactor.save()

See Also