Text · 52 tools · nothing uploads

Prefix or suffix lines

Prefix or suffix lines. Runs entirely on your device, nothing is uploaded.

Input

Options

live

Prefix or suffix lines adds a fixed prefix, a fixed suffix, or both, to every line of a pasted text. Both fields default to empty, so leaving one out skips it for every line. Each line's text is otherwise untouched; empty lines receive the same prefix and suffix. Different text per line is not supported.

Questions

What if I only want a prefix and no suffix?

Leave suffix blank; it defaults to an empty string, so only the prefix option needs a value. The same applies in reverse for a suffix-only run.

Are empty lines given a prefix and suffix too?

Yes. The tool adds the prefix and suffix to every line unconditionally, including lines that are already empty, which turns them into a line holding only the prefix and suffix text.

Can I add different text to different lines?

No. Every line in the file receives the exact same prefix and the exact same suffix; there is no per-line or pattern-based option here.

Does it work well for building a quoted list, like CSV values?

It can, since prefix and suffix are free text; setting both to a quote character wraps every line in quotes. There is no separate escaping step, so a line that already contains that character is not escaped for you.

What happens to a trailing newline in my file?

It is preserved: the tool notes whether the input ends in a newline before adding the prefix and suffix, and restores that same trailing newline afterward.

Compare

ToolRuns on the CLILive as you type
Prefix or suffix linesYesYes
Number linesYesYes
Reverse linesYesYes
Shuffle linesYesYes
Sort lines by lengthYesYes
Unique lines with countsYesYes
Extract linesYesYes

Related Text tools