My requirement is that when ever search criteria matchs in log file, the previous line just above the search word as well as search word should be print.
sample log file
--03-19T11:26 xxx create version "a.sh@@/main/6"
"104157 "
--03-18T16:01 xxx create version "a.sh@@/main/5"
"104157 "
--03-16T12:51 xxx create version "a.sh@@/main/4"
"874569"
--03-09T17:49 xxx create version "a.sh@@/main/3"
"874569"
--02-23T07:21 xxx create version b.sh@@/main/14
"94145"
--02-22T07:12 xxx create version "b.sh@@/main/13"
"94145"
--02-21T00:10 xxx create version "b.sh@@/main/12"
"2010"
```[/i]
No if i search for 94145, then output shoul be \-
```text
--02-23T07:21 xxx create version b.sh@@/main/14 <-- previous line
"94145" <-- search critria
--02-22T07:12 xxx create version b.sh@@/main/13 <-- previous line
"94145" <-- search critria
another example, if user search for 2010, then output should be -[/i]
--02-21T00:10 xxx create version "b.sh@@/main/12"
"2010"
Any kind of help will be appriciated.
Thanks in advance.