diff options
Diffstat (limited to 'doc/gawktexi.in')
-rw-r--r-- | doc/gawktexi.in | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/gawktexi.in b/doc/gawktexi.in index a82a1b37..842fafe6 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -396,6 +396,7 @@ particular records in a file and perform operations upon them. field. * Command Line Field Separator:: Setting @code{FS} from the command-line. +* Full Line Fields:: Making the full line be a single field. * Field Splitting Summary:: Some final points and a summary table. * Constant Size:: Reading constant width data. * Splitting By Content:: Defining Fields By Content @@ -6024,6 +6025,7 @@ with a statement such as @samp{$1 = $1}, as described earlier. * Regexp Field Splitting:: Using regexps as the field separator. * Single Character Fields:: Making each character a separate field. * Command Line Field Separator:: Setting @code{FS} from the command-line. +* Full Line Fields:: Making the full line be a single field. * Field Splitting Summary:: Some final points and a summary table. @end menu @@ -6392,6 +6394,21 @@ the entries for users who have no password: awk -F: '$2 == ""' /etc/passwd @end example +@node Full Line Fields +@subsection Making The Full Line Be A Single Field + +Occasionally, it's useful to treat the whole input line as a +single field. This can be done easily and portably simply by +setting @code{FS} to @code{"\n"} (a newline).@footnote{Thanks to +Andrew Schorr for this tip.} + +@example +awk -F'\n' '@var{program}' @var{files @dots{}} +@end example + +@noindent +When you do this, @code{$1} is the same as @code{$0}. + @node Field Splitting Summary @subsection Field-Splitting Summary |