Quote:
Originally Posted by MTK358
Is it possible to match something not even related to the current record?
|
Well, not really. Built-in variables as NR, NF, and so on are related to the current record. Regular expression are matched against the current record. However you can test for variables that have been assigned before, for example:
Code:
/regexp/ { count++ }
count >= 10 { action }
In this poor example, the variable count is incremented every time a record matches the regexp, whereas the second rule is executed only after count has reached a value of 10. In this case the answer is yes: the value of count is not strictly related to the current record.