gawk: Testing field creation

1 
1 4.8 Checking How 'gawk' Is Splitting Records
1 ============================================
1 
1 As we've seen, 'gawk' provides three independent methods to split input
1 records into fields.  The mechanism used is based on which of the three
1 variables--'FS', 'FIELDWIDTHS', or 'FPAT'--was last assigned to.  In
1 addition, an API input parser may choose to override the record parsing
1 mechanism; please refer to ⇒Input Parsers for further information
1 about this feature.
1 
1    To restore normal field splitting after using 'FIELDWIDTHS' and/or
1 'FPAT', simply assign a value to 'FS'.  You can use 'FS = FS' to do
1 this, without having to know the current value of 'FS'.
1 
1    In order to tell which kind of field splitting is in effect, use
1 'PROCINFO["FS"]' (⇒Auto-set).  The value is '"FS"' if regular
1 field splitting is being used, '"FIELDWIDTHS"' if fixed-width field
1 splitting is being used, or '"FPAT"' if content-based field splitting is
1 being used:
1 
1      if (PROCINFO["FS"] == "FS")
1          REGULAR FIELD SPLITTING ...
1      else if (PROCINFO["FS"] == "FIELDWIDTHS")
1          FIXED-WIDTH FIELD SPLITTING ...
1      else if (PROCINFO["FS"] == "FPAT")
1          CONTENT-BASED FIELD SPLITTING ...
1      else
1          API INPUT PARSER FIELD SPLITTING ... (advanced feature)
1 
1    This information is useful when writing a function that needs to
1 temporarily change 'FS' or 'FIELDWIDTHS', read some records, and then
1 restore the original settings (⇒Passwd Functions for an example
1 of such a function).
1