#!/usr/bin/awak -f BEGIN { if (block == 0) block = 1 if (field == 0) field = 1 if (start == 0) start = 1 } /.*/ { split($0, blocks, "|") split(blocks[block], fields) data = fields[field] print data }