GroupDocs.Redaction allows to redact data of sensitive or private nature from your XLS, XLSX, ODS spreadsheet document formats and others. See full list at supported document formats article.
Filter by spreadsheet and column
If you have a document with one or more tables, organized into worksheets (one table per worksheet) - such as Microsoft Excel documents - you can use specific type of textual redactions, CellColumnRedaction. It allows you to set the scope of the redaction to a specific worksheet and/or column. The options are:
optionally set worksheet name or its numeric index (if both are missing, redaction affects all worksheets)
optionally set column (all columns are used, if the column filter is not set)
If no filters are set, redactions affects the entire document. All indices are zero-based. Below is an example, where we use all filters, to redact second column with emails (e.g. loaded from database) on a worksheet “Customers”, leaving untouched all other emails in the document:
C#
using(Redactorredactor=newRedactor("D:\\Sales in September.xslx")){varfilter=newCellFilter(){ColumnIndex=1,// zero-based 2nd columnWorkSheetName="Customers"};varexpression=newRegex("^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$");RedactorChangeLogchangeLog=redactor.Apply(newCellColumnRedaction(filter,expression,newReplacementOptions("[customer email]")));if(result.Status!=RedactionStatus.Failed){doc.Save(newSaveOptions(){AddSuffix=true});};}
More resources
Advanced usage topics
To learn more about document redaction features, please refer to the advanced usage section.
GitHub examples
You may easily run the code above and see the feature in action in our GitHub examples:
Along with full featured .NET library we provide simple, but powerful free Apps.
You are welcome to perform redactions for various document formats like PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, Emails and more with our free online Free Online Document Redaction App.
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.