in reply to How to loop over multiple datasets (blocks of text)?
I'm sure some much more knowledgeable PERLy folks will follow this suggestion with some much more technical ideas, etc. but in the mean-time, the one thing I notice about your data that you're showing, is that they all have a consistent first and last line of each of the data sets.
Could you not utilise that consistency to perform a loop to process each dataset until you either come to the end of the set, or the end of DATA?
In other words, change these two lines:
next if /Data_Set_\d+: /; next if /^NoCoordinateCount/;
into a couple of loops looking for the start and end of your data set, so you can process each set individually.
|
|---|