mercredi 26 août 2015

Extract data before and after matching (BIG FILE )

I have got a big file ( arounf 80K lines ) my main goal is to find the patterns and pring for example 10 lines before and 10 lines after the pattern . the pattern accures multiple times across the file . using the grep command :

grep -i <my_pattern>* -B 10 -A 10 <my_file>

i get only some of the data , i think it must be something related to the buffer size ....

i need a command ( grep , sed , awk ) that will handle all the matching and will print 10 line before and after the pattern ...

Aucun commentaire:

Enregistrer un commentaire