For example: If below is the content of my log file, I want to keep only the contents between the first occurrence of value '2018' and last occurrence of '2018'
sssssssssssssssssssss
ddddddddddddddddddddd
2018fffffffffffffffff
dddddd2018ddddddddddd
wwww2018wwwwwwwwwwwww
aaaaaaaaaaaa2018aaaaa
Output should be:
2018fffffffffffffffff
dddddd2018ddddddddddd
wwww2018wwwwwwwwwwwww
aaaaaaaaaaaa2018