CellColumnRedaction
Leave feedback
On this page
Represents a text redaction that replaces text in a spreadsheet documents (CSV, Excel, etc.).
public class CellColumnRedaction : TextRedaction
| Name | Description |
|---|---|
| CellColumnRedaction(CellFilter, Regex, ReplacementOptions) | Initializes a new instance of CellColumnRedaction class. |
| Name | Description |
|---|---|
| ActionOptions { get; } | Gets the ReplacementOptions instance, specifying type of text replacement. |
| override Description { get; } | Returns a string, describing the redaction and its parameters. |
| Filter { get; } | Gets the column and worksheet filter. |
| OcrConnector { get; set; } | Gets or sets the IOcrConnector implementation, required to extract text from graphic content. |
| Pattern { get; } | Gets the regular expression to match. |
| Name | Description |
|---|---|
| override ApplyTo(DocumentFormatInstance) | Applies the redaction to a given format instance. |
Learn more
- More details about applying redactions: Redaction basics
- More details about spreadsheet redactions: Spreadsheet redactions
The following example demonstrates removing user emails from a second column on “Customers” worksheet of a spreadsheet document.
using (Redactor redactor = new Redactor("D:\\Sales in September.xslx"))
{
var filter = new CellFilter()
{
ColumnIndex = 1, // zero-based 2nd column
WorkSheetName = "Customers"
};
var expression = new Regex("^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$");
RedactorChangeLog changeLog = redactor.Apply(new CellColumnRedaction(filter, expression, new ReplacementOptions("[customer email]")));
if (result.Status != RedactionStatus.Failed)
{
doc.Save(new SaveOptions() { AddSuffix = true });
};
}
- class TextRedaction
- namespace GroupDocs.Redaction.Redactions
- assembly GroupDocs.Redaction
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.