Magic Tools
Document ProcessingBy CooconApril 22, 2026216 views3 min read

Text Cleaning Tool Usage Guide: Remove Spaces, Delete Blank Lines, Strip HTML Tags All in One Page

Why does text often 'look normal but act messy'?

Text copied from PDFs, webpages, chat logs, or tables often carries various invisible issues: extra spaces, consecutive blank lines, HTML tags, curly quotes, tab characters, strange symbols. It looks fine to the naked eye, but starts causing errors as soon as it's pasted into a system.

The most hassle-free approach at this point is not to manually delete bit by bit, but to first perform a text cleaning.

What can this tool clean?

At tools.cooconsbit.com/tools/text-cleaner, you can check rules as needed, such as:

  • Trim leading and trailing spaces from each line
  • Merge extra spaces
  • Merge extra blank lines
  • Remove all blank lines
  • Strip HTML tags
  • Convert curly quotes to straight quotes
  • Remove special characters
  • Remove numbers
  • Remove punctuation
  • Normalize line endings
  • Replace tabs with spaces
  • Convert to lowercase or uppercase
  • Decode common HTML entities

Handling content copied from webpages

If the original text contains tags like <p>, <div>, <span>, you can check:

  • Strip HTML tags
  • Decode HTML entities
  • Collapse spaces

This way, you can quickly get plain text.

Handling messy formats after copying from PDF

The most common issues with PDF text are messy spaces, many blank lines, and tabs mixed in. Usually, you can first check:

  • Trim each line
  • Collapse spaces
  • Remove extra blank lines
  • Replace tabs with spaces

Handling data text to be imported into systems

If the target system is sensitive to characters, you can further check:

  • Normalize line endings
  • Remove special characters

But for this step, preview the results first to avoid deleting symbols that are originally useful.

The most important point when using

Don't check all options at once.

Text cleaning isn't about being as harsh as possible, but about being as targeted as possible. For example, if you just want to remove blank lines, there's no need to also delete punctuation; if you just want to strip HTML, you don't necessarily have to convert everything to uppercase.

Who is it suitable for?

  • Content operators: cleaning collected text
  • Developers: handling API input parameters or test data
  • Editors: organizing copied manuscripts
  • Students and office users: cleaning PDF or webpage copied content

Frequently Asked Questions FAQ

Q: Will entity characters be automatically removed after stripping HTML tags?

A: If the original text contains content like &amp;, &nbsp;, you can also check HTML entity decoding.

Q: Will removing special characters delete Chinese characters?

A: It's recommended to check the output result before copying. When dealing with multi-language text, cleaning should be more cautious.

Q: Can I recover if I accidentally delete something?

A: The page has a recovery logic that retains the original content before clearing, suitable for temporary rollback.

Summary

The greatest value of a text cleaning tool is that it centralizes common 'text dirty data processing' into one page. You don't need to write regular expressions, nor do you have to repeatedly find and replace in an editor; by checking rules according to your goal, you can quickly get cleaner results.

Tool address: tools.cooconsbit.com/tools/text-cleaner

Related Articles

Blocking rm -rf in Claude Code: A Deny Rule Stopped 14 Deletes in Two Weeks, 7 Other Spellings Still Get Through, and a Hook That Closes the Gap

To keep Claude Code from deleting things by accident, I added a deny rule, Bash(rm -rf *), to my global settings. Across my sessions from October 7 to 21 it blocked 14 deletes. After each denial the model picked a new directory name 8 times and dropped the delete 6 times. It never tried another spelling. Then I replayed 22 delete commands verbatim against Claude Code 2.1.285 through a stub. rm -fr, rm -r -f, rm -Rf and rm -r deleted the directory in manual, auto and bypass mode alike. /bin/rm, find -delete and bash -c deleted it in manual and bypass mode. In auto mode, rm -fr inside the working directory skips the classifier because it 'would be allowed in acceptEdits mode'. A second, built-in dangerous-rm check fires on targets like $D/*, even in bypass mode, but loses track of a variable assignment when a heredoc comes earlier in the same command. The post ends with a PreToolUse hook that blocks every recursive spelling in all three modes and tells the model what to do instead.

claude-codehooks+5
pitfallsOct 21, 20268 min
208

The Self-Reinforcing Flywheel Is Harder Than It Looks: 40 Days of an LLM Auto-Tuning Loop

We ran an 'LLM proposes, code decides' auto-tuning loop on a daily WeChat newsletter for 40 days: 18 versions, 8 rollbacks. Three of those rollbacks overturned decisions a human had made, and one version whose knobs were identical to its parent still got rolled back. Using our real numbers, telling apart a 20% difference needs about 25,000 reads per version. At 60 reads a day, that is more than 400 days. This postmortem covers five reasons the flywheel never turned, and what actually moved the numbers.

wechatpostmortem+4
pitfallsOct 21, 20268 min
133

Dev Breakfast · 2026-10-21

Today's headline: A single "bonsoir, Elliot" makes the model leak its .env: a backdoor for under $50. Plus 4 more: DeepSeek open-sources its inference engine: V4.1 Flash only, and KV cache still missing; TorchTPU goes open source: PyTorch models can run directly on TPU; and more.

daily-intelOct 21, 20268 min
446

Dev Breakfast · 2026-10-20

Today's headline: Should You Merge AI Code You Don't Understand: Settle the Abstraction Layer Yourself First. Plus 4 more: tmux as a Remote Control: Multi-Session Claude Code and send-keys; headroom Goes Open Source: 95% Token Savings on JSON, Only 20% for Coding Agents; and more.

daily-intelOct 20, 20265 min
415

Published by Magic Tools