I have a file, we'll call it file.txt. It has thousands of lines of all kinds of output at any given time (ie. foo bar foo bar)
I need to copy out just a portion of the file from Point-A to Point-B. I'd like to save off just that portion to a file called test123xyz.txt.
How do I do that?
Code:
1. foo
2. bar
3. foo
4. bar
5. <<<BEGIN test123xyz (<--Point-A)
6. foo
7. bar
8. foo
9. bar
~
~
~
~
~
~
991. foo
992. bar
993. foo
994. bar
995. >>>END test123xyz (<--Point-B)
996. foo
997. bar
998. foo
Now the good thing is, there are markers where I need to make the copy happen (ie. <<<BEGIN test123xyz)
I'm sure this is a simple grep, sed, awk or something that I can do but I've tried everything I know of with no success. Any ideas?
HP-UX 11.31, korn shell scripting.