guys help me with the below. I run the below command to get 7 lines after the pattern in a file but im not able to include even the pattern into the file2.
gawk 'c-->0;/pattern/{c=7}' file1 > file2
guys help me with the below. I run the below command to get 7 lines after the pattern in a file but im not able to include even the pattern into the file2.
gawk 'c-->0;/pattern/{c=7}' file1 > file2
ok,
grep -A 7 -Ev 'pattern' file1 > file2
print the pattern .. Modified code ..
$ gawk 'c-->0;/pattern/{print;c=7}' file1 > file2
Thanks jayan_jay