Thanks guys for the suggestions what I have done now is use a grep -n and a cut command to isolate the linenumber followed by a head command in case there is more than one instance of the pattern (I only want the first) and then pass this variable to an sed command and it works fine
grep -n "pattern" log.txt | cut -f1 -d:>TEST.TXT
firstOccurenceLineNum=`head -1 TEST.TXT`
# Get linenum-1 of first instance and delete up to there
firstOccurenceLineNum=`expr $firstline - 1`
sed "1,$firstline d" <log.txt >TEST.TXT