Text Formatter

Processing rules 0

No processing rules yet. Click "Add rule"Or"Quick rules"Start configuring

Formatted result

Quick rules

Regular expression example

\d+
Match digits
[a-zA-Z]+
Match letters
\s+
Match whitespace characters
^\s*
Match leading whitespace
\s*$
Match trailing whitespace
"[^"]*"
Match quoted content
\w+@\w+\.\w+
Match email format
https?://\S+
Match URLs
\r?\n|\r
Match carriage returns and line breaks
\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b
MatchIPAddress

Text Formatter user guide

This tool batch-cleans text and supports two processing modes: line-by-line and full-text. You can delete, replace, or extract the prefix, suffix, or entire content of each line. Typical use cases: stripping wrapping characters from each line of JSON/CSV/log data, capturing content before or after a separator, extracting specific field values, and trimming fixed-length prefixes/suffixes.。

Core features

🔧 Concise matching pattern

  • Line prefix processing:Match and process strings at the start of a line
  • Line suffix processing:Match and process strings at the end of a line
  • Full-line processing:Find and process matched content across the entire line.
  • Full-text processing:Process the entire text before splitting into lines (such as line break replacement))
  • Regular expression:Supports complex pattern matching
  • Dynamic rule list:Add multiple rules to process in order

⚙️ Smart processing options

  • Remove:Remove matched strings
  • Replace:Replace the matched string with the specified content.
  • Keep only:Keep only the matched string and remove everything else (used for field extraction))
  • Split into lines:Replace matched strings with line breaks
  • Remove this line:Delete entire lines containing the matched content (whole-line mode only))
  • Remove blank lines:Quickly remove all blank lines from the text (full-text mode only))
  • Live preview:See the result instantly after configuring rules
  • Error message:Real-time detection of regular expression syntax errors

Use case examples

🔑 User ID extraction

Extract user ID information from log files for user behavior analysis.

Input: [2024-01-15 10:23:45] INFO User login successful, USERID: 12345, SESSION: abc123
Configuration:Full-line regular expression match USERID: \d+,Choose processing method"Keep only"
Output: USERID: 12345

🐳 Docker Log cleanup

Extract key information from container logs, removing timestamps and container names.

Input: [2024-01-15 10:23:45] INFO container-web-app-1 - Application started
Configuration:Use a regex prefix to remove timestamps and whole-line matching to remove container names.
Output: INFO Application started

📊 Nginx Access log processing

Extract status codes and response times from access logs.

Input: 192.168.1.1 - - [15/Jan/2024:10:24:16] "GET /api/users HTTP/1.1" 200 1024 45ms
Configuration:Use regex matching to extract status codes and response times.
Output: 200 45ms

🔍 Kubernetes Pod Log aggregation

Clean up K8s log formatting for a consistent output format.

Input: 2024-01-15T10:23:45.123Z stdout F [ERROR] Database connection failed
Configuration:Use regex to remove timestamps and stream info while keeping the log content.
Output: [ERROR] Database connection failed

🛠️ Batch process configuration files

Batch-edit parameter values in configuration files

Input: database.host=localhost:3306
Configuration:Suffix match =localhost:3306,Replace with =prod-db:3306
Output: database.host=prod-db:3306

🔄 CSV Data cleaning

Clean quotes and special characters from CSV data.

Input: "user_001","John Doe","[email protected]","Active"
Configuration:Remove quotes from prefixes and suffixes, and replace commas with tabs across the whole line.
Output: user_001 John Doe [email protected] Active

📋 API Response extraction

Extract specific field values from JSON logs.

Input: {"timestamp":"2024-01-15T10:23:45Z","level":"INFO","message":"User login successful","userId":"12345"}
Configuration:Use regex matching to extract the userId field value.
Output: 12345

🧹 Text cleanup and formatting

Quickly remove extra blank lines from a document to improve readability.

Input: User data


User 1: John Smith

User 2: Jane Doe


Statistics complete

Configuration:Full-text mode, choose how to process"Remove blank lines"
Output: User data
User 1: John Smith
User 2: Jane Doe
Statistics complete

🚫 Log filtering

Batch-delete log lines containing specific keywords, for example filtering out DEBUG-level logs.

Input: [INFO] Application started
[DEBUG] Loading config file
[ERROR] Connection failed
[DEBUG] Retry attempt 1

Configuration:Full-line mode, match content DEBUG,Choose processing method"Remove this line"
Output: [INFO] Application started
[ERROR] Connection failed

How to use

1

Configure processing rules

Choose the matching mode for the prefix and suffix as needed, set the relevant parameters, and select a delete or replace operation.

2

Enter source text

Type or paste the text you want to process into the left editor, with file import supported.

3

View the result and export

View the live processing result on the right, then copy it or export it as a file once you’ve confirmed it’s correct.