User Tools

Site Tools


awk:awk_variables

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:awk_variables [2021/01/06 15:51] – [IGNORECASE] peterawk:awk_variables [2021/01/06 15:55] (current) – [FNR] peter
Line 204: Line 204:
  
 It represents the number of the current record in the current file. It represents the number of the current record in the current file.
 +
 +<code bash>
 +echo -e "One Two\nOne Two Three\nOne Two Three Four" | awk 'FNR < 3'
 +</code>
 +
 +returns:
 +
 +<code>
 +One Two
 +One Two Three
 +</code>
  
 <WRAP info> <WRAP info>
Line 243: Line 254:
 </code> </code>
  
 +<WRAP info>
 **NOTE:**  If IGNORECASE does not work then try: **NOTE:**  If IGNORECASE does not work then try:
  
Line 248: Line 260:
 awk 'tolower($0) ~ /peter/' test.txt awk 'tolower($0) ~ /peter/' test.txt
 </code> </code>
 +
 +</WRAP>
  
 ---- ----
Line 270: Line 284:
 </code> </code>
  
 +<WRAP info>
 +**NOTE:**  This only works with GAWK, not AWK.
 +</WRAP>
  
 ---- ----
awk/awk_variables.1609948284.txt.gz · Last modified: 2021/01/06 15:51 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki