LinuxCommandLibrary

colrm

TLDR

Remove first column from stdin

$ colrm 1 1
copy
Remove from column 3 to end of each line
$ colrm 3
copy
Remove columns 3 to 5
$ colrm 3 5
copy

SYNOPSIS

colrm [first] [last]

DESCRIPTION

colrm removes selected columns from text read from standard input. Columns are counted from 1. If only one argument is given, columns from that number to the end of line are removed.
The tool is useful for text processing pipelines where specific column ranges need to be stripped.

PARAMETERS

first

First column to remove (1-indexed)
last
Last column to remove (optional, defaults to end of line)

CAVEATS

Column counting starts at 1, not 0. Tabs are treated as advancing to the next multiple of 8 columns. Part of the util-linux package.

SEE ALSO

cut(1), column(1), awk(1)

Copied to clipboard