awk:begin_and_end
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
awk:begin_and_end [2021/01/06 15:39] – peter | awk:begin_and_end [2022/06/13 09:40] (current) – peter | ||
---|---|---|---|
Line 13: | Line 13: | ||
< | < | ||
10 | 10 | ||
- | 11 | + | 11 |
12 | 12 | ||
13 | 13 | ||
Line 30: | Line 30: | ||
</ | </ | ||
- | which will display something like: | + | returns: |
< | < | ||
NUMBER | NUMBER | ||
</ | </ | ||
+ | |||
+ | ---- | ||
This would be more useful when run as: | This would be more useful when run as: | ||
Line 42: | Line 44: | ||
</ | </ | ||
- | which will display something like: | + | returns: |
< | < | ||
Line 53: | Line 55: | ||
6 48 Adam Winter | 6 48 Adam Winter | ||
</ | </ | ||
+ | |||
+ | <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. | ||
+ | |||
+ | </ | ||
---- | ---- | ||
Line 77: | Line 84: | ||
</ | </ | ||
- | which will display something like: | + | returns: |
< | < | ||
Total Value of Inventory: 174.65 | Total Value of Inventory: 174.65 | ||
</ | </ | ||
+ | |||
+ | ---- | ||
This would be more useful when run as: | This would be more useful when run as: | ||
Line 89: | Line 98: | ||
</ | </ | ||
- | which will display something like: | + | returns: |
< | < | ||
Line 98: | Line 107: | ||
Total Value of Inventory: 174.65 | Total Value of Inventory: 174.65 | ||
</ | </ | ||
+ | |||
+ | <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. | ||
+ | |||
+ | </ | ||
---- | ---- | ||
awk/begin_and_end.1609947554.txt.gz · Last modified: 2021/01/06 15:39 by peter