Add Suffix to Text Lines
Add a custom suffix to every line of text instantly. Supports custom separators, empty line skipping, trimming, and bulk text processing.
About
Appending a consistent suffix to every line of a multi-line block is a routine task in data preparation, log formatting, and code generation. Manual editing introduces typos and costs time that scales linearly with line count - 500 lines at 3 seconds each is 25 minutes of mechanical labor. This tool processes n lines in constant time, applying a user-defined suffix S with an optional separator sep between the original content and the appended string. It handles edge cases: empty lines can be preserved or skipped, leading/trailing whitespace can be trimmed before concatenation, and the separator is configurable (space, tab, or arbitrary string). The operation is deterministic - identical input always yields identical output - so results are safe to pipe into downstream scripts or databases.
Common applications include adding file extensions to filename lists, appending domain suffixes to usernames, tagging CSV rows, and inserting line-ending characters for protocol-specific formats. Note: this tool operates on plain text only. If your lines contain structured markup, verify that the suffix does not break tag nesting. For lines exceeding 10,000 characters, browser rendering may introduce slight latency, though the concatenation logic itself remains O(n).
Formulas
The suffix operation applies a simple concatenation formula to each line independently:
Where Li is the original content of line i, sep is the chosen separator string (empty string, space U+0020, tab U+0009, or a custom string), and S is the suffix to append. When the "trim lines" option is active, Li is first passed through a whitespace strip function:
When "skip empty lines" is enabled, the conditional logic is:
Total time complexity is O(n ⋅ m) where n is the number of lines and m is the average line length, dominated by string copying during concatenation.
Reference Data
| Use Case | Original Line Example | Suffix | Separator | Result |
|---|---|---|---|---|
| File extensions | report_2024 | .csv | None | report_2024.csv |
| Email domains | john.doe | @company.com | None | [email protected] |
| CSS classes | .card | --active | None | .card--active |
| SQL values | ('Alice', 30) | , | None | ('Alice', 30), |
| Log tagging | Connection timeout | [ERROR] | Space | Connection timeout [ERROR] |
| URL paths | /api/v2/users | ?limit=100 | None | /api/v2/users?limit=100 |
| Markdown lists | Item one | ; | None | Item one; |
| HTML attributes | <div | class="box"> | None | <div class="box"> |
| Batch commands | del file | /q | None | del file /q |
| Unit labeling | 45.7 | kg | None | 45.7 kg |
| CSV quoting | John,Doe,30 | " | None | John,Doe,30" |
| Version tags | release | -v2.1.0 | None | release-v2.1.0 |
| Tab-separated | Name | Value | Tab | Name Value |
| Line numbering aid | Process data | // step 1 | None | Process data // step 1 |
| DNS records | .example.org. | None | mail.example.org. |