Free Support Forum - groupdocs.com

How to redact a text file in csharp

I get an error when I try to redact “Sample.txt”
when New Redactor(“Sample.txt”) is executed.
The error is “The stream contains document, which format is not supported”
This is a valid text file. It is in your sample files. It is UTF-8, I saved a new text file as ANSI and tested it with same error.

@elumicor

This issue is reproduced at our end. Hence, we’ve logged it in our internal issue tracking system with ID REDACTIONNET-307. As there’s any update, you’ll be notified.

@elumicor

This sample TXT file is used by two examples on GitHub, covered by these articles in documentation:

Please have a look at the supported file formats. This file is used as .log plain text file for example codes. You can use one of these approaches to apply redactions to this file.

Yes, I seen the custom format handler. You mean that a .txt is not handled by default?

I apply the following code to my vb.net testing app and it works on the sample.txt file.
Dim config = RedactorConfiguration.GetInstance()
Dim docxSettings = config.FindFormat(".docx")
docxSettings.ExtensionFilter = docxSettings.ExtensionFilter & “,.log,.txt”

@elumicor

Yes, you have to use any of the above mentioned approaches to apply redaction to the TXT file.