awk 'BEGIN{RS=""} !/code : 0/ { match ($0, /code : [0-9]+/, a) print $0 > "/tmp/file_" gensub(/code : /, "", 1, a[0]) }'