Получите файл до совпадения, не включив

sed '/[match]/q' file.txt	
#Include q option at the end to grep until match only
Armandres