Changes

Jump to: navigation, search

Tutorial11: Sed & Awk Utilities

138 bytes added, 09:00, 4 March 2021
Using the awk Utility
'''Patterns: Regular ExpressionsSelection Criteria''' * You can use a regular expression, enclosed within slashes, as a pattern. ��For example: /pattern/�* The ~ operator tests whether a field or variable matches a �regular expression.��For example: $1 ~ /^[0-9]/�* The !~ operator tests for no match.��For example: $2 !~ /line/* You can perform both numeric and string comparisons using �relational operators ( > , >= , < , <= , == , != ).* You can combine any of the patterns using the Boolean operators �|| (OR) and && (AND).* You can use built-in variables (like NR or "record number" �representing line number) with comparison operators.��For example: NR >=1 && NR <= 5
*You can use a '''regular expression''', enclosed within slashes, as a pattern.
*The '''~''' operator tests whether a field or variable matches a regular expression
*The '''!~''' operator tests for no match.
*You can perform both numeric and string comparisons using relational operators
*You can combine any of the patterns using the Boolean operators '''||''' (OR) and '''&&''' (AND)
*You can use '''built-in variables''' (like '''NR''' or "record number" representing line number) with comparison operators
13,420
edits

Navigation menu