sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

cut.1 (1500B)


      1 .Dd October 8, 2015
      2 .Dt CUT 1
      3 .Os sbase
      4 .Sh NAME
      5 .Nm cut
      6 .Nd extract columns of data
      7 .Sh SYNOPSIS
      8 .Nm
      9 .Fl b Ar list
     10 .Op Fl n
     11 .Op Ar file ...
     12 .Nm
     13 .Fl c Ar list
     14 .Op Ar file ...
     15 .Nm
     16 .Fl f Ar list
     17 .Op Fl d Ar delim
     18 .Op Fl s
     19 .Op Ar file ...
     20 .Sh DESCRIPTION
     21 .Nm
     22 out bytes, characters or delimited fields from each line of
     23 .Ar file
     24 and write to stdout.
     25 .Pp
     26 If no
     27 .Ar file
     28 is given or
     29 .Ar file
     30 is '-',
     31 .Nm
     32 reads from stdin.
     33 .Pp
     34 .Ar list
     35 is a comma or space separated list of numbers and ranges starting
     36 from 1.
     37 Ranges have the form 'N-M'. If N or M is missing, beginning or end
     38 of line is assumed.
     39 Numbers and ranges may be repeated, overlapping and in any order.
     40 .Pp
     41 Selected input is written in the same order it is read
     42 and is written exactly once.
     43 .Sh OPTIONS
     44 .Bl -tag -width Ds
     45 .It Fl b Ar list | Fl c Ar list
     46 .Ar list
     47 specifies byte | character positions.
     48 .It Fl d Ar delim
     49 Use
     50 .Ar delim
     51 as field delimiter, which can be an arbitrary string.
     52 Default is '\et'.
     53 .It Fl f Ar list
     54 .Ar list
     55 specifies field numbers.
     56 Lines not containing field delimiters are passed through, unless
     57 .Fl s
     58 is specified.
     59 .It Fl n
     60 Do not split multibyte characters.
     61 A character is written when its last byte is selected.
     62 .It Fl s
     63 Suppress lines not containing field delimiters.
     64 .El
     65 .Sh STANDARDS
     66 The
     67 .Nm
     68 utility is compliant with the
     69 .St -p1003.1-2013
     70 specification.
     71 .Pp
     72 The possibility of separating numbers and ranges with a space and specifying
     73 multibyte delimiters of arbitrary length is an extension to that specification.