I have seen there are many sed posts but still it is quite difficult to apply other post to my own problem
How can I delete all lines in a file from 2 lines after this pattern
*End_fine_coreg:_NORMAL
to the end of file?
Cheers
I have seen there are many sed posts but still it is quite difficult to apply other post to my own problem
How can I delete all lines in a file from 2 lines after this pattern
*End_fine_coreg:_NORMAL
to the end of file?
Cheers
Adjust num according to the number of lines you want printed after the line in question:
num=2
awk -v num=$num '/*End_fine_coreg:_NORMAL/ { n = 1 }
NR - n > num { exit }
{print}' "$FILE"
use this code:
csplit file1 /*End_fine_coreg:_NORMAL/+3
it will create two file named x00 x01 then u get ur desire result in x00 file.