get match from start of file until last match code example
Example: get file until match without including
sed '/[match]/q' file.txt
#Include q option at the end to grep until match only
sed '/[match]/q' file.txt
#Include q option at the end to grep until match only