if you want to preserve white-space, you better forget about fields
and work with indexes on the string, match is your friend:

% echo '1      3 4           8' | awk '{match($0, /[ \t]*[^ \t]+[
\t]+/);a=RLENGTH+1;match(substr($0, a), /[ \t]/);print
substr($0,0,a-1) "hell" substr($0,RSTART+a)}'
1      hell 4           8

this is indeed a bit OT here, maybe next time you prefer trying in
#awk at freenode, where this kind of problems are welcomed

-- 
- yiyus || JGL . 4l77.com

Reply via email to