in reply to How to restart a while loop that is iterating through each line of a file?

Your title says

> ... that is iterating through each line of a file ...

your post says

> ... trying to take the first 16 lines of a single file ...

that's confusing.

I see three possible cases:

The second example in the following post shows an approach to generically solve all cases with just minor changes:

Re^2: Grab 3 lines before and 2 after each regex hit (sliding window)

HTH!

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

  • Comment on Re: How to restart a while loop that is iterating through each line of a file?

Replies are listed 'Best First'.
Re^2: How to restart a while loop that is iterating through each line of a file?
by cookersjs (Acolyte) on Nov 29, 2016 at 14:30 UTC
    Sorry about the confusion, should have double-checked my title made sense

    -cookersjs