doc: Add an example for cutting fields separated by runs of blanks
authorPádraig Brady <P@draigBrady.com>
Mon, 8 Mar 2010 08:48:14 +0000 (08:48 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 9 Mar 2010 00:32:07 +0000 (00:32 +0000)
* doc/coreutils.texi (cut invocation): Show how tr can be used
to process the input for cut in this case.
Suggestion from Dan Jacobson.

doc/coreutils.texi

index fcee336..3e7a698 100644 (file)
@@ -5318,7 +5318,13 @@ of selected bytes.
 Select for printing only the fields listed in @var{field-list}.
 Fields are separated by a TAB character by default.  Also print any
 line that contains no delimiter character, unless the
-@option{--only-delimited} (@option{-s}) option is specified
+@option{--only-delimited} (@option{-s}) option is specified.
+Note @command{cut} does not support specifying runs of whitespace as a
+delimiter, so to achieve that common functionality one can pre-process
+with @command{tr} like:
+@example
+tr -s '[:blank:]' '\t' | cut -f@dots{}
+@end example
 
 @item -d @var{input_delim_byte}
 @itemx --delimiter=@var{input_delim_byte}