Problem statement: I two files a.txt
start b2
1
2
3
end
start b1
4
5
6
end
file b.txt
start b1
4
5
7
end
start b2
1
2
3
end
I'm trying to compare the block which contains the lines start - end from file b.txt to a.txt for each occurrences and store it to another file c.txt But I'm unable to do it What I tried so far:
- file = a.txt, s = 2 and e = 4
sed -n 2,4\p a.txt
2)awk '/StartPattern/,/EndPattern/' FileName
but none of it worked
expected output/execution workflow
step 1:
from file b.txt
grab the data block of
start b1
4
5
7
end
and it compare with data block of start to end of file a.txt
after comparing
output should be:
start b1
4
5
7
end