Prefix Lines

Add the same prefix to every line, including comment markers or quote characters.

What Prefix Lines helps you do

Add the same prefix to every line, such as a comment marker, a quote character or a bullet. It is the quick way to turn plain lines into commented code or a formatted list. The prefix is literal text, so you choose the syntax rather than the tool guessing a language.

Prefixing runs in your browser with no text sent to Haivix.

How it works

Line tools split the pasted text into lines, apply one operation to the list, and rejoin it with a newline. A blank line is still a line, so it participates in sorting, numbering and shuffling unless you remove it first. The transformation runs in the browser and keeps the existing line order except where the tool's purpose is to change it. Nothing is uploaded, and the output replaces the preview rather than the source. If the input ends with a newline, the final empty line can affect a count or a shuffle; trim the input first when that matters.

How to use Prefix Lines

  1. Paste the lines you want to prefix.
  2. Enter the prefix text, such as two slashes or a dash and space.
  3. Apply and check the first and last lines.
  4. Copy the prefixed lines.

When to use it

  • Comment out a block of code by adding a line-comment marker.
  • Turn plain lines into a Markdown or shell list.
  • Add a quote character before every line of a block quote.
  • Prefix log lines with a ticket number.
  • Add a bullet before a list copied from a document.
  • Prefix SQL lines with a comment marker for a stored note.

When not to use it

  • Do not use it when the lines need different prefixes.
  • Do not use it on code that will be executed; the prefix may change syntax.
  • Do not expect blank lines to be skipped automatically.

Example

Prefixing three lines with a slash-slash makes each one a comment in JavaScript or C-style languages. A blank line between them also receives the marker, which is usually harmless but can look odd in a block quote. The prefix is capped at 200 characters and is added verbatim.

What you can do with Prefix Lines

  • Add a prefix of up to 200 characters to every line.
  • Include blank lines as well as text lines.
  • Use a comment marker, quote character or bullet.
  • Keep the original line content after the prefix.
  • Copy the prefixed block.
  • Run the operation locally with no upload.

Example: check the line structure first

Paste a small sample and note how many lines it has, including blank lines and a possible trailing newline. The count explains most surprises after sorting, numbering or filtering.

Apply the operation and compare the first and last lines with the source. If the structure is right, run the full text; if not, remove the blank lines or trim the input first.

Copy or download the result and keep the original until the destination accepts it. Line tools are one-way, so the source is the only undo.

For a list pasted from a spreadsheet, check for hidden carriage returns or wrapping quotes before transforming it. A stray quote can sort differently or survive a filter that looks correct at a glance.

When the result feeds another tool, run a second pass only after confirming the first. Chaining a sort and a deduplication is safe, but chaining two numbering steps produces duplicated prefixes.

If the output is going into a version-controlled file, check the diff before committing. A blank-line or line-ending change can look like a content change in review even when the words are unchanged.

What to know before you start

  • The prefix is literal, so it does not choose the correct comment syntax for a language.
  • Blank lines receive the prefix too unless you exclude them.
  • There is no per-line or conditional prefixing.
  • The prefix is capped at 200 characters.

Common mistakes

  • Prefixing code and then running it, where the prefix changes the syntax.
  • Forgetting that blank lines also receive the prefix.
  • Choosing a prefix that already exists on the line and doubling it.
  • Expecting the tool to choose the correct comment syntax for a language.

Troubleshooting

If the prefix appears twice, the source already had it; remove the existing prefix first.

If blank lines look wrong, remove empty lines before prefixing.

If the prefix is truncated, it exceeded the 200-character limit.

If the content shifted, the prefix is part of every line by design.

Related standards and documentation

  • A newline is a single line separator in Unix text; Windows files may use CRLF.
  • Modern JavaScript sorts are stable, so equal lines keep their relative order.
  • Blank lines are entries, not separators, in these transformations.
  • A trailing newline is a text convention, not content; remove it before counting lines.
Blank lines are still lines
  • Count the lines before you transform.
  • Remove blanks first when they should not participate.
  • Keep the original until the result is accepted.
  • Check the last line for a trailing newline.

Frequently Asked Questions