Need help with file parsing
I have a file that looks something like this:
... lots of stuff ...
... more stuff ...
.. more stuff ...
I need to get the "more stuff" (in bold) - it's several lines. If it's easier to have "FrameBegin" and "FrameEnd" included in the results, that's fine. Actually, there are 100 FrameBegin/FrameEnds that I will be pulling out into separate files, but if I know how to do one, I can figure out how to do them all. I have a feeling I can do it with something simple like sed and awk as opposed to writing a c++ program or perl script., but I'm having trouble.
Does anyone have an idea?
This could help (awk based):
I took the liberty to create outputfilenames based on FrameBegin 1, FrameBegin 2 etc. (the number being the unsure thing....). It's there to give you an idea and can be changed to your liking.
The importent part is the /^FrameBegin/,/^FrameEnd/ part. This makes sure that only the Frames and wat is inside are targeted.
You can do something simular with sed: sed -n '/^FrameBegin/,/^FrameEnd/p' infile.
Hope this clears things up a bit.
Thanks for the code too. :D
|All times are GMT -5. The time now is 05:11 PM.|