ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahz_5.4.0.1/cut.htm

99 lines
3.0 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8">
<title>cut - Cut out selected fields of each line of a file</title>
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</HEAD>
<body bgcolor="#FFFFFF">
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h2>cut - Cut out selected fields of each line of a file</h2>
<strong>Synopsis</strong>
<p><strong>cut -b</strong> <em>list</em> [<em>file ...</em>]</p>
<p><strong>cut -c</strong> <em>list</em> [<em>file ...</em>]</p>
<p><strong>cut -f</strong> <em>list</em> <strong>[-d</strong> <em>
string</em><strong>] [-s]</strong> [<em>file</em> ...]</p>
<p><strong>Description</strong></p>
<p>The <strong>cut</strong> utility selects portions of each line
as specified by <em>list</em> from each <em>file</em> (or the
standard input by default), and writes them to the standard output.
The items specified by <em>list</em> can be in terms of column
position or in terms of fields delimited by a special character.
Column numbering starts from 1.</p>
<p>The <em>list</em> is a comma or whitespace separated set of
increasing numbers and/or number ranges. Number ranges consist of a
number, a dash (-), and a second number and select the fields or
columns from the first number to the second, inclusive. Numbers or
number ranges may be preceded by a dash, which selects all fields
or columns from 1 to the first number. Numbers or number ranges may
be followed by a dash, which selects all fields or columns from the
last number to the end of the line. Numbers and number ranges may
be repeated, overlapping, and in any order. It is not an error to
select fields or columns not present in the input line.</p>
<p><strong>Options</strong></p>
<dl>
<dt><strong>-b</strong> <em>list</em></dt>
<dd>The <em>list</em> specifies byte positions.</dd>
<dt><strong>-c</strong> <em>list</em></dt>
<dd>The <em>list</em> specifies character positions.</dd>
<dt><strong>-d</strong> <em>string</em></dt>
<dd>Use the first character of <em>string</em> as the field
delimiter character instead of the tab character.</dd>
<dt><strong>-f</strong> <em>list</em></dt>
<dd>The <em>list</em> specifies fields, delimited in the input by a
single tab character. Output fields are separated by a single tab
character.</dd>
<dt><strong>-s</strong></dt>
<dd>Suppresses lines with no field delimiter characters. Unless
specified, lines with no delimiters are passed through
unmodified.</dd>
</dl>
<p><strong>Exit Status</strong></p>
<ul>
<li>0 on success</li>
<li>1 if an error occurred.</li>
</ul>
<p><strong>Related information</strong></p>
<ul>
<li><a href="grep.htm">grep - Search a file for a pattern</a></li>
<li><a href="tr.htm">tr - translate characters</a></li>
<li><a href="wc.htm">wc - Word, line and byte/character
count</a></li>
</ul>
<!-- end ibmbody========================================================= -->
</body>
</html>