Link to home
Start Free TrialLog in
Avatar of Zizi
Zizi

asked on

Awk for multiple patterns

Hi,

I am trying to search multiple patterns where I would the start and end of the first few characters. This works for a single pattern.

awk '/test_pattern/ { match($0, /test_pattern/); print substr($0, RSTART - 10, RLENGTH + 20);' file

How do I do it for multiple patterns? Thank you
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zizi
Zizi

ASKER

Thank you Bill!
Welcome.


»bp