About Us Documentation

Contact Site Map
 

  

WinPak
Documentation

Go to the previous, next chapter.

Operating on fields within a line

cut: Print selected parts of lines

cut writes to standard output selected parts of each line of each input file, or standard input if no files are given or for a file name of -. Synopsis:

cut [option]... [file]...

In the table which follows, the byte-list, character-list, and field-list are one or more numbers or ranges (two numbers separated by a dash) separated by commas. Bytes, characters, and fields are numbered from starting at 1. Incomplete ranges may be given: -m means 1-m; n- means n through end of line or last field.

The program accepts the following options. Also see section Common options.

-b byte-list --bytes=byte-list -b --bytes Print only the bytes in positions listed in byte-list. Tabs and backspaces are treated like any other character; they take up 1 byte.

-c character-list --characters=character-list -c --characters Print only characters in positions listed in character-list. The same as -b for now, but internationalization will change that. Tabs and backspaces are treated like any other character; they take up 1 character.

-f field-list --fields=field-list -f --fields Print only the fields listed in field-list. Fields are separated by a TAB by default.

-d delim --delimiter=delim -d --delimiter For -f, fields are separated by the first character in delim (default is TAB).

-n -n Do not split multibyte characters (no-op for now).

-s --only-delimited -s --only-delimited For -f, do not print lines that do not contain the field separator character.

paste: Merge lines of files

paste writes to standard output lines consisting of sequentially corresponding lines of each given file, separated by TAB. Standard input is used for a file name of - or if no input files are given.

Synopsis:

paste [option]... [file]...

The program accepts the following options. Also see section Common options.

-s --serial -s --serial Paste the lines of one file at a time rather than one line from each file.

-d delim-list --delimiters delim-list -d --delimiters Consecutively use the characters in delim-list instead of TAB to separate merged lines. When delim-list is exhausted, start again at its beginning.

join: Join lines on a common field

join writes to standard output a line for each pair of input lines that have identical join fields. Synopsis:

join [option]... file1 file2

Either file1 or file2 (but not both) can be -, meaning standard input. file1 and file2 should be already sorted in increasing order (not numerically) on the join fields; unless the -t option is given, they should be sorted ignoring blanks at the start of the line, as in sort -b.

The defaults are: the join field is the first field in each line; fields in the input are separated by one or more blanks, with leading blanks on the line ignored; fields in the output are separated by a space; each output line consists of the join field, the remaining fields from file1, then the remaining fields from file2.

The program accepts the following options. Also see section Common options.

-a file-number -a Print a line for each unpairable line in file file-number (either 1 or 2), in addition to the normal output.

-e string -e Replace those output fields that are missing in the input with string.

-1 field -j1 field -1 -j1 Join on field field (a positive integer) of file 1.

-2 field -j2 field -2 -j2 Join on field field (a positive integer) of file 2.

-j field Equivalent to -1 field -2 field.

-o field-list... Construct each output line according to the format in field-list. Each element in field-list consists of a file number (either 1 or 2), a period, and a field number (a positive integer). The elements in the list are separated by commas or blanks. Multiple field-list arguments can be given after a single -o option; the values of all lists given with -o are concatenated together.

-t char Use character char as the input and output field separator.

-v file-number Print a line for each unpairable line in file file-number (either 1 or 2), instead of the normal output.

In addition, when GNU join is invoked with exactly one argument, options --help and --version are recognized. See section Common options.


 

 

Email addresses listed on this site may  NOT be used for unsolicited commercial email.

Ready-to-Run Software, Inc Privacy Statement

Portions (c)Copyright, 1996-2005 by Ready-to-Run Software, Inc
(All rights reserved.)
212 Cedar Cove
Lansing, NY 14882
Phone: 607 533 UNIX (8649)
Fax: 607 533 4002