Hello fasoli,
I want to ignore the first 12 lines...
If you know in advance that the number of lines to ignore is exactly 12, you can use the range operator in scalar context like this:
next if 1 .. 12;
(This works because it’s short for next if ($. == 1 .. $. == 12);) But:
In line 12, which is one line above where I want to start data copying, there is a unique pattern (@TYPE xy). I'd prefer to match this line and then tell the script to start copying from the next (13) line onwards.
In this case, change the range as follows:
while (<$input>) { next if 1 .. /\@TYPE xy/; printf ...; }
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: column counter and printf question
by Athanasius
in thread column counter and printf question
by fasoli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |