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 [2021/01/06 15:23] peterawk:begin_and_end [2022/06/13 09:40] (current) peter
Line 13: Line 13:
 <file> <file>
 10   Peter     Terence   Roux        45 10   Peter     Terence   Roux        45
-11   Virginia  Genevive  Roux        45+11   Virginia  Genevieve  Roux       45
 12   Felix     Devon     Roux         5 12   Felix     Devon     Roux         5
 13   David     Bruce     Stevenson   48 13   David     Bruce     Stevenson   48
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>
 NUMBER ITEM QUANTITY PRICE NUMBER ITEM QUANTITY PRICE
 1 10 Peter Terence 1 10 Peter Terence
-2 11 Virginia Genevive+2 11 Virginia Genevieve
 3 12 Felix Devon 3 12 Felix Devon
 4 13 David Bruce 4 13 David Bruce
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.1609946621.txt.gz · Last modified: 2021/01/06 15:23 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki