DevTools Logo

Text Column Cutter

Text Column Cutter

Extract fields from every line like awk or cut, or slice fixed-width character ranges.

Runs in your browser
Try an example

Input text

Extracted columns

Paste lines to cut columns

Results update as you type. Nothing leaves your browser.

Details

Paste logs, CSV-like exports or fixed-width reports and pick the fields you want. Field numbers are 1-based, -1 means the last field, 0 keeps the whole line, and ranges such as 2-4 or lists such as 2,4 are joined back with the same delimiter (or one you choose). Consecutive separator runs can collapse like awk whitespace or stay as empty fields like cut -d. Missing fields can become empty values, skip the line, or show a -- placeholder. Fixed-width mode slices inclusive 1-based character ranges using Unicode code points, so emoji count as one character. Splitting is literal, not regular-expression based; the optional quote-aware mode is deliberately partial and not a replacement for strict CSV parsing.

More examples

Status codes from an access log

Input: 127.0.0.1 - - [27/Nov/2026:10:00:00 +0000] "GET /api HTTP/1.1" 200 512
Delimiter: space, collapse runs on, fields: 9
Output: 200

Whitespace runs collapse exactly like awk's default field splitting, so aligned log columns keep their expected numbers.

Mount points from df -h

Input: /dev/sda1        99G   62G   32G  67% /
Delimiter: space, collapse runs on, fields: 6
Output: /

Variable spacing between columns is normalized before the sixth field is selected.

Semicolon export, two columns

Input: 1;Ada Lovelace;admin;London
Delimiter: semicolon, fields: 2-3
Output: Ada Lovelace;admin

Ranges are inclusive and the extracted fields are rejoined with the input delimiter.

Fixed-width report

Input: 2026-11-27INFO   started
Ranges: 1-10,11-16, join with space
Output: 2026-11-27 INFO

Character positions are 1-based and inclusive and are counted as Unicode code points.

    Examples

    Status codes from an access log

    Input
    127.0.0.1 - - [27/Nov/2026:10:00:00 +0000] "GET /api HTTP/1.1" 200 512
    Delimiter: space · Collapse runs: on · Fields: 9
    Output
    200

    Whitespace runs collapse like awk, so the status code is field 9 even when columns are padded.

    Two columns from a semicolon export

    Input
    1;Ada Lovelace;admin;London
    Delimiter: semicolon · Fields: 2-3
    Output
    Ada Lovelace;admin

    Ranges are inclusive and selected fields are rejoined with the input delimiter.

    Fixed-width date and level

    Input
    2026-11-27INFO   started
    Ranges: 1-10,11-16 · Join: space
    Output
    2026-11-27 INFO

    Positions are 1-based inclusive code-point ranges, so emoji and accented letters count as one character.

    Use cases

    Check a pasted access log

    Pull the HTTP status, request path or user agent out of raw log lines without opening a terminal.

    Turn df output into a mount-point list

    Use space delimiter with collapsed runs and field 6 to normalize the uneven spacing in df -h.

    Preview one column of a semicolon export

    Choose field 2 or a range like 2-3 to inspect a column before importing the export elsewhere.

    Slice a fixed-format report

    Use character ranges such as 1-10,21-30 when records are aligned by position instead of a delimiter.

    Common mistakes

    Mistake:Counting leading spaces as empty fields when extracting aligned log columns.

    Fix:Choose Space as the delimiter and turn on Collapse runs to match awk whitespace splitting.

    Mistake:Writing a reversed range such as 3-2 and expecting it to select two fields.

    Fix:Write ranges in ascending order (2-3), or use a comma list (3,2) to control output order.

    Mistake:Assuming quote-aware mode is a full CSV parser.

    Fix:Use it only as a quick check; strict CSV with embedded newlines needs a dedicated CSV parser.

    Frequently asked questions

    How do I print the second column of a file online?

    Paste the lines into the input panel, choose the delimiter that separates your columns, set Fields to 2, and read the result on the right. For example, a tab-delimited line a b c produces b. The result updates as you type, and you can copy or download it without installing anything.

    What is the difference between this and awk or cut?

    The field numbers and ranges follow the same 1-based convention as awk and cut, but this page runs in your browser with a live preview. It adds comma lists, negative last-field indexes, a whole-line selector and explicit policies for missing fields. Collapse runs reproduces awk's whitespace splitting; leaving it off keeps empty fields like cut -d.

    How are consecutive delimiters treated?

    By default each delimiter creates a new field, so a b has three fields and the middle one is empty. Turn on Collapse runs when your rows are aligned with repeated spaces: a run becomes a single separator, leading and trailing runs are ignored, and field numbers match awk's whitespace fields.

    Can I extract multiple columns at once?

    Yes. Use an inclusive range such as 2-4, a comma list such as 2,4, or combine both as 1,3-5. The selected fields are rejoined with the same delimiter by default; you can choose a different separator, including none, in the Join fields with control.

    Does it understand quoted CSV fields?

    Only partially. Quote-aware splitting skips delimiters inside double-quoted fields and handles doubled quotes, but it is not RFC-complete and does not support quoted multiline records. For strict CSV with type-aware parsing, use a dedicated CSV parser. Nothing you paste is uploaded anywhere; all processing stays in your browser.

    References & standards