CellColumnRedaction class
Leave feedback
On this page
Represents a text redaction that replaces text in spreadsheet documents (CSV, Excel, etc.).
Learn more
- More details about applying redactions: https://docs.groupdocs.com/redaction/python-net/redaction-basics/
- More details about spreadsheet redactions: https://docs.groupdocs.com/redaction/python-net/spreadsheet-redactions/
The CellColumnRedaction type exposes the following members:
| Constructor | Description |
|---|---|
| init | Initializes a new CellColumnRedaction. |
| Method | Description |
|---|---|
| apply_to | Applies the redaction to a given format instance. |
| 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) |
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()
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.