learningawk
Technical User
I am having trouble understanding how regular expressions work using AWK.
I am trying to match certain characters in a substr field.
For example:
field 1=123-2N
if (match ($1,/^[1][0-9][0-9].?[N])) { print}
In my input file I have several different combinations of like data, such as:
field 1=123-2N
field 1=123-2N1
field 1=123-2N11
field 1=123-2Nb
field 1=223-2N
I would only like the match to occur when it finds a match on the input of
123-2N
Thanks for helping.
I need a quick problem to be solved.
I am trying to match certain characters in a substr field.
For example:
field 1=123-2N
if (match ($1,/^[1][0-9][0-9].?[N])) { print}
In my input file I have several different combinations of like data, such as:
field 1=123-2N
field 1=123-2N1
field 1=123-2N11
field 1=123-2Nb
field 1=223-2N
I would only like the match to occur when it finds a match on the input of
123-2N
Thanks for helping.
I need a quick problem to be solved.