What You Can Do with GroupDocs.Redaction for Java

Clean Up XLSX Files Using Java

Remove sensitive content from XLSX files with Java and GroupDocs.Redaction for Java. Keep your spreadsheets secure.

Redact Data from Xlsx Files

Use GroupDocs.Redaction for Java in any Java app to remove text or hidden content before sharing.

  1. Create a Redactor instance and load your file.
  2. Select the redaction options you want.
  3. Choose the text to find and its replacement.
  4. Apply redaction and save your document.
// How to redact a XLSX spreadsheet

// Create a Redactor and load your file
final Redactor redactor = new Redactor("input.xlsx");
try
{
    // Choose your redaction settings
    // Enter search and replacement text
    ReplacementOptions opt = new ReplacementOptions("[redacted]");
    
    ExactPhraseRedaction redaction = new ExactPhraseRedaction("Text to hide", opt);

    // Apply changes and save
    redactor.apply(redaction);
    redactor.save();
}
finally { redactor.close(); }
<dependencies> <dependency> <groupId>com.groupdocs</groupId> <artifactId>groupdocs-redaction</artifactId> <version>24.6</version> </dependency> </dependencies> <repositories> <repository> <id>repository.groupdocs.com</id> <name>GroupDocs Repository</name> <url>https://repository.groupdocs.com/repo/</url> </repository> </repositories>
click to copy
copied
More examples Documentation

Helpful Redaction Tools

GroupDocs.Redaction for Java helps remove private content from various files. Clean up documents without losing formatting.

Smart content protection

Search and replace text

Find and update or hide sensitive data in cells.

Cover visuals

Hide charts, images, or ranges using colored overlays.

Clear metadata

Remove author info, creation dates, and other background data.

Redaction Using Regex

Find and redact values like account numbers or patterns using regex.

Java

//  Open the file to process
final Redactor redactor = new Redactor("source.xlsx");
try
{
    // Add an EMAIL regex rule and replacement
    ReplacementOptions repl_opt = new ReplacementOptions("[redacted]");
    String emailRegex = "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}";

    RegexRedaction redaction = new RegexRedaction(emailRegex, repl_opt);
    
    // Apply redaction rules
    redactor.apply(redaction);

    // Save the updated file
    SaveOptions saveOptions = new SaveOptions();
    saveOptions.setAddSuffix(true);
    saveOptions.setRasterizeToPDF(false);
    redactor.save(saveOptions);
}
finally { redactor.close(); }
<dependencies> <dependency> <groupId>com.groupdocs</groupId> <artifactId>groupdocs-redaction</artifactId> <version>24.6</version> </dependency> </dependencies> <repositories> <repository> <id>repository.groupdocs.com</id> <name>GroupDocs Repository</name> <url>https://repository.groupdocs.com/repo/</url> </repository> </repositories>
click to copy
copied
More examples Documentation

Why Use GroupDocs.Redaction for Java?

GroupDocs.Redaction for Java gives Java developers tools to clean XLSX files. Redact text, metadata, images, and more with a few lines of code.
Learn more
About illustration

Ready to get started?

Download GroupDocs.Redaction for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Redact Content in XLSX with Java

Clean and protect XLSX files using Java features for redaction and content removal.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English