13

awk get search pattern from a file.

view full story
linux-howto

http://www.unix.com – Here Is a problem I am facing with awk. Query --> I want to search for a string in a file and print next 15 lines below the matched string. 1.We do not have GNU grep so cannot use grep -A or grep -B commands. 2. Instead of passing the search pattern as a string to awk. I want the awk to read the pattern from a file. This is the command which I am using: Code: cat fulldatafile.txt | awk 'c-->0;/'`cat IDnumber.txt`'/{c=17}' So what I did: cat the full data file (file which contains information associated with ID) and then using the awk command I want to search for the only singl (HowTos)