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

Namespace: GroupDocs.Redaction.Redactions
Assembly: GroupDocs.Redaction (in GroupDocs.Redaction.dll) Version: 21.9
public class CellColumnRedaction : TextRedaction

The CellColumnRedaction type exposes the following members.

Public methodCellColumnRedaction
Initializes a new instance of CellColumnRedaction class.
Public propertyActionOptions
Gets the ReplacementOptions instance, specifying type of text replacement.
(Inherited from TextRedaction.)
Public propertyDescription
Returns a string, describing the redaction and its parameters.
(Overrides RedactionDescription.)
Public propertyFilter
Gets the column and worksheet filter.
Public propertyOcrConnector
Gets or sets the IOcrConnector implementation, required to extract text from graphic content.
(Inherited from TextRedaction.)
Public propertyPattern
Gets the regular expression to match.
Public methodApplyTo
Applies the redaction to a given format instance.
(Overrides RedactionApplyTo(DocumentFormatInstance).)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodProcessAsTextual
This method applies a given Regular Expression to an instance of the doucument, if it implements ITextualFormatInstance interface and returns RedactionStatus.Skipped otherwise.
(Inherited from TextRedaction.)
Public methodToString (Inherited from Object.)
Learn more
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 });
See Also