9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] awk help; not plan9 matter
@ 2009-09-17  8:23 Rudolf Sykora
  2009-09-17  8:37 ` matt
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Rudolf Sykora @ 2009-09-17  8:23 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,

simple task.
I want to change the 2nd field on each line of a file, but preserve
the spacing of the lines.

If I do
  awk '{$2="hell"; print}' file
the field gets changed, but all the spacing of the lines is gone; i.e.
any space is now just ' ' like this:
1      3 4           8
changes to
1 hell 4 8
while I need
1      hell 4           8.

Any help?
Thanks
Ruda



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2009-09-17 21:24 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-17  8:23 [9fans] awk help; not plan9 matter Rudolf Sykora
2009-09-17  8:37 ` matt
2009-09-17  8:52   ` Rudolf Sykora
2009-09-17  9:04 ` matt
2009-09-17  9:12   ` Rudolf Sykora
2009-09-17 10:42     ` Rudolf Sykora
2009-09-17 12:35       ` yy
2009-09-17 12:55         ` Rudolf Sykora
2009-09-17 15:51     ` Lyndon Nerenberg - VE6BBM/VE7TFX
2009-09-17 16:02       ` erik quanstrom
2009-09-17 16:20         ` roger peppe
2009-09-17 16:55         ` Rudolf Sykora
2009-09-17 17:04           ` erik quanstrom
2009-09-17 17:10             ` erik quanstrom
2009-09-17 17:19               ` Rudolf Sykora
2009-09-17 17:34                 ` roger peppe
2009-09-17 20:33                   ` Rudolf Sykora
2009-09-17 20:46                     ` erik quanstrom
2009-09-17 21:09                       ` Rudolf Sykora
2009-09-17 21:22                         ` Rudolf Sykora
2009-09-17 21:24                         ` erik quanstrom
2009-09-17 14:16 ` Noah Evans
2009-09-17 14:45   ` roger peppe
2009-09-17 17:03   ` Rudolf Sykora

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).