Add prefix or suffix to lines

Add a prefix, suffix, numbering or template to each line.

Text

Transform a list line by line with prefixes, suffixes, quick templates, advanced numbering and custom template mode. The tool can also import a .txt file, copy the result and download it locally.

Line formatting settings

Choose a quick pattern or build your own formatting with prefix, suffix, numbering and line options.

Quick pattern

Prefix / suffix

Number position

Options

Available placeholders: {line}, {n}, {number}, {index}, {comma}.

Summary

Input lines
0
Output lines
0
Characters
0

0 chars · 0 lines

Quick explanation

Paste your text or import a .txt file, choose a quick template or your own settings, then generate a ready-to-use version. Custom template mode accepts variables such as {line}, {n}, {number}, {index} and {comma} for precise formats.

Try this too

Need to split text into blocks?

Use the Split text tool to divide long content into blocks of characters, words, lines, paragraphs or a custom separator.

Try this tool

Additional information

Format a list line by line

This tool quickly transforms a multi-line text. It can add a prefix, a suffix, numbering or a complete custom template around each line, without sending your data to the server. It is useful for preparing Markdown lists, HTML elements, keywords, quoted values, angle-bracket values or small text exports.

Prefix, suffix and quick templates

The basic idea is simple: each source line is reused in the result, with optional text added before and after it. Quick templates automatically fill these settings for common formats: Markdown list, numbered list, square brackets, angle brackets, <li> tags or quoted comma-separated values.

Templates remain editable: after choosing one, you can adjust the prefix, suffix, numbering and options to get the exact output you need.

Advanced numbering

Numbering adds a number to each line. You can choose the start value, the step between lines, the minimum number of digits and the text placed after the number. For example, start at 1, step 1, three digits and the separator “ - ” can produce lines such as “001 - text”.

The number position controls whether the number is placed before the prefix or after the prefix. This makes it possible to produce formats like “1. - text” or “- 1. text”.

Custom template mode

Custom template mode lets you define the complete structure of each output line. In this mode, the classic prefix and suffix fields are not used: the template decides the final format.

You can use several variables in the template:

  • {line}: the line content;
  • {n}: the formatted number, using the start value, step and digit count;
  • {number}: the formatted number with the text placed after the number;
  • {index}: the line position in the list, starting at 1;
  • {comma}: a comma except on the last line.

Custom template examples:

  • {n}. {line} to create a numbered list;
  • <li data-id="{n}">{line}</li> to generate HTML elements;
  • "{line}"{comma} to create quoted values without a trailing comma.

Numbering settings are therefore still useful in custom template mode whenever the template contains {n} or {number}.

Useful options

The tool can ignore empty lines, trim spaces at the beginning and end of each line, or avoid adding the suffix to the last line. The final result can then be copied or downloaded as a .txt file.

Limits and reuse

AppErgo tools are provided free of charge for practical and informational purposes. Although care is taken in their design, a result may be incomplete, unexpected or incorrect. Before relying on a result for any important use, check it using an appropriate method.

To report a bug in the tool, you can use the dedicated bug report form.

Results produced by AppErgo tools may be copied and reused freely. When publicly reusing a result, a method or an AppErgo page, a link to the relevant page is appreciated.

Unless otherwise stated, AppErgo texts, images, visual elements, scripts, templates and internal components remain the property of AppErgo.

For any other request, you can contact the webmaster.