sed -n "1,/This is the temp line/"!p infile > outfile