DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Using awk

Multiline records

Records are normally separated by newlines, so that each line is a record; you can change this, but only in a limited way. You can set the built-in record separator variable RS to an empty string as follows:

   BEGIN   { RS = "" }
Input records can be several lines long; a sequence of empty lines separates records. A common way to process multiple-line records is to set the record separator to an empty line and the field separator to a newline, as in the following example:
   BEGIN   { RS = ""; FS = "\n" }
A record is limited to 3000 characters. See ``Multiline records and the getline function'' and ``Cooperation with the shell'' for some other examples of processing multiline records.
Next topic: Multiline records and the getline function
Previous topic: Input separators

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003