AI Agent Hub
Back to skills
Text Whitespace Cleaner icon

Text Whitespace Cleaner

Office Efficiency Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @user_15292d5a/yjkj-cn-whitespace-cleaner by following https://skillhub.cn/install/skillhub.md.

About this skill

Problem

When processing Chinese text copied from web pages, logs, forms, or AI output, extra spaces, invisible tab characters, and scattered line breaks are common. These characters are easy to miss, but they can affect search matching, data cleaning, prompt preparation, and published formatting. cn-whitespace-cleaner does not rewrite content; it normalizes whitespace into a predictable shape.

How It Works

The skill breaks whitespace cleanup into deterministic steps:
- Remove extra spaces: reduce layout noise caused by repeated spaces;
- Remove line breaks: compress meaningless breaks for easier joining or searching;
- Remove all tabs: delete tab characters to avoid alignment drift;
- Normalize whitespace: keep a consistent spacing style instead of depending on the original source.

It is implemented with the pure Python standard library, so it has no extra dependencies and fits well in scripts, batch jobs, or local text pipelines. For engineers, the value is turning a familiar “looks fine but hard to handle” text problem into fixed, repeatable rules.

Boundaries

It is suitable for cases where text content must be preserved and only whitespace should be tidied, such as cleaning CSV fragments, organizing log summaries, preparing search terms, or normalizing AI responses. It does not change meaning, translate, compress prose, or automatically repair complex Markdown structure. If a document relies on tabs, indentation, or specific line breaks to express structure, confirm whether those characters must be preserved before applying cleanup.

Use Cases

  • Clean copied web text before importing it into a spreadsheet.
  • Tidy log summaries by removing stray line breaks and tabs for line-based search.
  • Normalize Chinese AI snippets into single paragraphs before comparison.
  • Batch-clean CSV cells in a Python script to avoid space or tab mismatches.

Best For

  • Python engineers cleaning external text need a fixed whitespace rule.
  • Data engineers maintaining log search need tabs and line breaks removed.
  • Prompt engineers organizing AI output for comparison need normalized whitespace.
  • Operations staff importing web text into spreadsheets need extra spaces cleaned.