Using Sed to read one line only

I have a bash script which produces the desired output (mostly).

tempTxt=`sed -n '79,/^$/p' <sourceFile.txt | cut -c 13-19`

What this produces is the text from the 79th line of the source file and cuts the text to the 13th through the 19th chars.

Then the script does the same thing for the two lines in the source file following the 79th. In essence the script pulls the text from lines 79-81, when what I want is only the 79th line. The line begins with the pattern $ ( dollar sign) in the text string.

I have seen many examples on how to give sed a range of lines, but how do I tell it to stop once the line in question is complete?

Thanks in advance.

If awk is allowed:

awk 'NR==79{print substr($0, 13, 7);exit}' sourceFile.txt 

Your question is somewhat unclear. If you want just the 79th line then use

tempTxt=`sed -n '79p' <sourceFile.txt | cut -c 13-19`

I will try this and repost the output

tempTxt=`sed -n '79p' <sourceFile.txt | cut -c 13-19`

worked really well