sed '/Station Name/,$!d; /Data End/q'
That is delete any line except for the first one containing "Station Name" and up to the last line ($). Then for those that lines that have escaped the d
command, quit if it matches "Data End" (but print it before quitting).
So it prints the lines between the first occurrence of "Station Name" and the first occurrence of "Data End" after that (including if on the same line as "Data End").
Now, if the boundaries are to be ommitted, it's more complicated.
sed -ne '1,/Station Name/d; /Data End/!{p;n;}' -e q
Would work except if "Station Name" is to be found on the first line or on the same line as "Data End". Some sed
implementation allow you to refer to line 0
in a line range, but that's not portable. There are work arounds though. See the sed FAQ.
It gets even more complicated if you want to find the text between the first occurence of "Station Name" and the last occurrence of "Data End" because in that case, you're never sure you've reached the last "Data End" before you've reached the end of the file. sed would need to hold the lines it's seen after seeing a "Data End" until the end of the file or the next occurrence of "Data End", and because POSIX doesn't require sed implementations to be able to hold more than 10 lines of input, it can't be done portably with sed
so you'd need to use other tools like perl or awk or do several passes into the file.