Skip to content

Line Prefix Suffix API

POST https://api.findutils.com/api/tools/line-prefix-suffix/execute

Add a prefix, a suffix, or line numbers to every line of a text. Numbering starts at any value, steps by any amount, pads with zeros on request, and can skip blank lines.

Request body

application/json
  • text

    string required

    Newline-separated input.

  • prefix

    string optional

    Text to put at the start of each line. Default: none. Default "".

  • suffix

    string optional

    Text to put at the end of each line. Default: none. Default "".

  • number_lines

    boolean optional

    Put a line number before each line. Default: false. Default false.

  • start_at

    integer optional

    First line number. Default: 1. Default 1.

  • step

    integer optional

    Increment between line numbers. Default: 1. Default 1.

  • number_format

    string optional

    Template for the number with {n} as the placeholder. Default: "{n}. " Default "{n}. ".

  • pad_numbers

    boolean optional

    Pad numbers with leading zeros to the width of the last number. Default: false. Default false.

  • skip_blank

    boolean optional

    Leave lines that hold only whitespace unchanged and unnumbered. Default: false. Default false.

Example arguments

Verified
{
  "text": "apples\npears",
  "number_lines": true
}