The [[awk]] utility can take its input from [[standard input]] or from [[file]]s. If no input files are specified at the command line, then [[awk]] will take its input from [[standard input]]. == Input is separated into records == In awk all input is separated into [[record]]s and each [[record]] is sequentially processed according to the [[rule]]s defined within the [[awk]] script. By default, each line of input is treated as a single [record] (or row of data). === Records are further divided into fields === In awk, [[record]]s are further divided into [[field]]s, making them easy to manage, because processing can take place against a particular data [[field]]. == Taking input from files == The [[awk]] utility reads its input [[file]]s in the order provided and performs its [[pattern matching]] cycle until all lines of input have been read. == Obtaining input using getline == The [[getline]] command enables [[awk]] to take input from a particular file without the need to specify the filename as a command line parameter. == Special variables related to input == The following [[special variable]]s are related to input: | *Variable* | *Description* | [[FNR]] | An informative variable that provides the record number within the current file | [[FS]] | A control variable that specifies the input field separator | [[NF]] | An informative variable that provides the number of fields within the current record | [[NR]] | An informative variable that provides the total number of records processed | [[RS]] | A control variable that specifies the input record separator
Summary:
This change is a minor edit.
Username: