I have a very large 100Mb + file, where all the content is on the same line. I want to find a pattern in this file and a few characters around this pattern.
For example, I would like to invoke a command similar to the one below, but where -A and -B are the number of bytes of non-lines:
cat very_large_file | grep -A 100 -B 100 somepattern
So, for a file containing such content:
1234567890abcdefghijklmnopqrstuvwxyz
With an image
890abc
and a before size of -B 3
and an after size of -A 3
I want him to return:
567890abcdef
Any advice would be great. Many thanks.
source
share