James
I hear what your saying, but for this snippet I just want to cycle through
the list, checking the number is correct either being 3or4 spaces between
them, a print out at the end would be fine. My real data, has ifo on lines
in between numbers, but the count between each number will be either 3 or 4.
In reality if it failed the number check I will break out into a
sub-routine.
My problem is working out the loop required to achieve this, I have been on
and off hacking at this for a week, each variation not quite getting there.
That I can probably help with.
The trick is to find out what makes the lines with the numbers unique, something the program can recognize. If they're simply one or more digit characters to the end of the line, and the lines between them are not, that should be easy. Use something like:
while (<DATA>) { # example file handle, line-by-line reading chomp; # drop newline characters if (/^(\d+)$/) { # this is one of our number lines, process accordingly # the number found is in $1 here } else { # if you need to process the in-between lines # this isn't a number line, process accordingly } }
Hope that helps. If not, send us some information about the real lines between the numbers, so we can modify the pattern accordingly. Good luck.
James
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]