Supressing new-lines in awk output

Sun NCAA matthew at sunpix.UUCP
Thu Feb 9 01:35:11 AEST 1989


In article <21638 at conexch.UUCP>, root at conexch.UUCP (Larry Dighera) writes:
> Is there a way to supress the newline at the end of awk's print output?

Try using awk's printf command.  If you don't include a '\n' in the format
specifier, non will be printed.

awk '{printf "%s ", $1} filename

> Is there a way to cause each "$1" to be printed with a space delimiter 

Notice space in above example. A '\t' could also be used to insert a tab.


-- 
Matthew Lee Stier     (919) 469-8300|
Sun Microsystems ---  RTP, NC  27560|          "Wisconsin   Escapee"
uucp: {sun, rti}!sunpix!matthew     |



More information about the Comp.unix.questions mailing list