📝
Conditional Text Appender and Prepender
Conditionally append or prepend text to your input based on multiple rules, patterns, and scopes. Ideal for batch text processing and log modification.
text
Input Text
Conditions
Output Text
About Conditional Text Appender and Prepender
This tool allows you to conditionally add text (append or prepend) to your input based on specific patterns. You can define multiple rules, each with its own pattern, text to add, and conditions for matching. It's ideal for batch processing text files, logs, or any plain text data where you need to apply context-sensitive modifications.
Features:
- Define multiple conditional rules for powerful text manipulation
- Specify text to prepend to the beginning of a line or the entire text
- Specify text to append to the end of a line or the entire text
- Match patterns based on "contains" or "does not contain" logic
- Apply rules per line or to the entire text block
- Case-sensitive matching option for precise control
- Clear input and copy output with one click
How to use:
- Paste your main text into the "Input Text" area.
- Click "Add New Condition" to create a rule. You can add multiple rules.
- For each rule:
- Enter the `Pattern` you want to match. This tool treats patterns as literal strings by default.
- Select whether the text `Contains` or `Does not contain` the pattern.
- Enter the `Prepender Text` (text to add before the matched line/text). This field can be left empty.
- Enter the `Appender Text` (text to add after the matched line/text). This field can be left empty.
- Choose `Scope`: `Per Line` (each line is evaluated independently) or `Entire Text` (the whole input is evaluated once).
- Toggle `Case Sensitive` if the pattern match should respect casing (e.g., "Error" is different from "error").
- Conditions are processed in the order they appear. You can remove a condition using the 'X' button.
- Click "Apply Conditions" to see the modified text in the "Output Text" area.
- Use the "Copy" button to easily copy the result to your clipboard.