I'm trying to select certain text from an output file.
I'm reading my file as follows:
while read line
do
if [ "$line" == "SUMMARY OF POLARIZATION CALCULATION" ]; then
break
fi
done < tutorial1/Tutorial1_1.out
When the loop reaches that "Summary" line, i need to read only the next 9 lines. I'm trying to use a for loop but i'm not sure how to use it:
for i in {1..9}
do
read line < tutorial1/Tutorial1_1.out
echo $line >> Summary.out
done
My output is as follows:
next is setrmt
next is setrmt
next is setrmt
next is setrmt
next is setrmt
next is setrmt
next is setrmt
next is setrmt
next is setrmt
But i need it to be the next 9 lines after the "SUMMARY" statement. Please help.
tutorial1/Tutorial1_1.outor in../Tutorial1_1.out? These are different files unlesstutorial1is a symlink to the parent directory.