Read a line, using "read", then use "case" to decide what to do.
read{
First lineIFS= <read File.txt-r Firstline
case "$Firstline" in
("HDR"*"1234"*) mv File.txt Pattern1.txt
echo "File with pattern1 received..." ;;
("HDR"*"5678"*) mv File.txt Pattern2.txt
echo "File with pattern2 received..." ;;
(*) echo "Nothing matched" ;;
esac
} < File.txt