I have a directory with 2000+ files. I need to look in each file for an invoice number. To identify this, i can search for the string 'BIG' and then retrieve the next 30 characters. I was thinking awk for this, but not sure how to do it. Each file contains one long string and in the middle is the invoice number. If i can find the position of the 'BIG' pattern, then grab the next 30 characters, I can extrapolate the invoice number I need.
I basically need to pull out all 2000+ invoice numbers and put them in one file, one invoice number per line.
Any help is much appreciated??
SAMPLE input:
TEST FILE|USING|NEW|SYSTEM|BIG|20130924|49685234|THIS ISNT THE END|BYE
output needed:
BIG|20130924|49685234
keep in mind i need to do this to 2000+ files in one directory.