User Tools

Site Tools


awk:begin_and_end

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
awk:begin_and_end [2022/06/13 09:28] – [AWK - BEGIN and END] peterawk:begin_and_end [2022/06/13 09:40] (current) peter
Line 30: Line 30:
 </code> </code>
  
-which will display something like:+returns:
  
 <code> <code>
 NUMBER   ITEM   QUANTITY   PRICE NUMBER   ITEM   QUANTITY   PRICE
 </code> </code>
 +
 +----
  
 This would be more useful when run as: This would be more useful when run as:
Line 42: Line 44:
 </code> </code>
  
-which will display something like:+returns:
  
 <code> <code>
Line 53: Line 55:
 6 48 Adam Winter 6 48 Adam Winter
 </code> </code>
 +
 +<WRAP info>
 +**NOTE:**  
  
   * The **BEGIN** has allowed the header to be added to the output.   * The **BEGIN** has allowed the header to be added to the output.
   * The **NR** variable used in the 2nd print numbers each line.  It is a built-in variable of AWK.   * The **NR** variable used in the 2nd print numbers each line.  It is a built-in variable of AWK.
 +
 +</WRAP>
  
 ---- ----
Line 77: Line 84:
 </code> </code>
  
-which will display something like:+returns:
  
 <code> <code>
 Total Value of Inventory: 174.65 Total Value of Inventory: 174.65
 </code> </code>
 +
 +----
  
 This would be more useful when run as: This would be more useful when run as:
Line 89: Line 98:
 </code> </code>
  
-which will display something like:+returns:
  
 <code> <code>
Line 98: Line 107:
 Total Value of Inventory: 174.65 Total Value of Inventory: 174.65
 </code> </code>
 +
 +<WRAP info>
 +**NOTE:**  
  
   * The **END** has allowed a total line to be added to the output.   * The **END** has allowed a total line to be added to the output.
       * It is only run at the end.       * It is only run at the end.
 +
 +</WRAP>
  
 ---- ----
  
  
awk/begin_and_end.1655112524.txt.gz · Last modified: 2022/06/13 09:28 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki