On 23.03.2013 23:48,
robert....@gmail.com wrote:
> W dniu sobota, 23 marca 2013 04:14:39 UTC+1 użytkownik Janis Papanagnou napisał:
[...]
>>
>> Your sample data seems to indicate that you want not only 2 but maybe
>> occasionally 3 more lines skipped, depending on the record length. If
>> I understood your task correctly, I think this awk program should do
>>
>> /^[0-9]/ {skip=($3~/ANR110[0-2]I/)}
>> !skip
>>
>>
[...]
> [...] I will get back as
> soon as I would be sure it solved my problem, in the meantime could you
> please explain how exactly does it work (i never saw skip function
> before...),
'skip' is no function, it's a variable.
> how can it properly cut exact number of lines to get rid of
> whole record and no more or less?
Whether to skip or not is determined on lines starting with a digit in
column 1; on each such lines the field #3 is compared to the pattern and
the boolean value is assigned to the variable skip. Then all lines that
are not to skip will be printed; print is the dafault action if only a
condition is defined (as in line 2).
Janis
>
> Robert
>>
[...]