I have a file where the 2nd column looks like this:
37M533N38M
14M1170N45M233N16M
3S45M3N35M
I want to extract those strings which contain 3N
but no other numbers immediately before the 3
. So, for example, A3N
would match but 23N
would not. It should also be noted that 3N
would never be present alone and the string will not start with 3N
and will not end with 3N
.
The result should be the third line from the above:
3S45M3N35M
How can I do it in awk? I have tried $2 ~ /3N/
but that certainly doesn't work.