Alexey Pechnikov wrote:

> awk 'BEGIN {OUT=0} /^-/ {BASE=NR; OUT=!OUT} /^[^-]/ { if (OUT) { if
> ((NR-BASE)%2) { FILENAME=substr($0,2) } else {print $1, "\t", $4, $5,
> "\t", FILENAME } } }'

Можно и так (только "\t" лишние). Или короче:

awk '/^-+$/ {OUT+=1; next}
OUT==1 {FILENAME=substr($0,2); getline; print $1, $4, $5, FILENAME}'


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Ответить