in reply to matching and writing multiple line blocks
Block 1 Start: Experiment End : Reagent Lot Size : 10 lines followed by one blank line Block 2 Start : Algorithm Parameters End : FCMax Size : 5 lines followed by one blank line Block 3 Start : Experiment End : Pixels Size : 8 lines followed by one blank line
I had already thought out a short cut - all blocks are the same size, so I simply needed to know how many experiments there were, say 4, and then count down through each of the blocks as I already know the order and size of each. So some simple addition and division could get me where I needed to be.
What I was pretty clueless about was how to match the first block and somehow write it to an output file, repeat for all the Block 1s, then do the same for all the Block 2, etc. I do want to learn how to do multiple line extractions of text - it is a good general technique and I can use it for other stuff - Thank you!
Now I'll go play with your suggestions...
MadraghRua
yet another biologist hacking perl....
|
|---|