9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Q: awk omit cols
@ 2009-11-19  8:34 Peter A. Cejchan
  2009-11-19  8:52 ` Russ Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Peter A. Cejchan @ 2009-11-19  8:34 UTC (permalink / raw)
  To: 9fans

Hi,

is there any way to print out, e.g. , $2 $3 $4.... $LAST,
i.e., just omitting $1 ?
I was advised to use 'cut' , but, according to plan9 wiki I should use
'awk' for 'cut'...

Thanks,
++pac.


=============================
Petr A. Cejchan
<cej@gli.cas.cz, tyapca7@gmail.com>
http://home.gli.cas.cz/cej/www/
http://www.facebook.com/cejchan
work: +420-233 087 237
home/SMS: +420-720 121 721
ICQ: 583000501
=============================



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

* Re: [9fans] Q: awk omit cols
  2009-11-19  8:34 [9fans] Q: awk omit cols Peter A. Cejchan
@ 2009-11-19  8:52 ` Russ Cox
  2009-11-19 10:17   ` Peter A. Cejchan
  0 siblings, 1 reply; 5+ messages in thread
From: Russ Cox @ 2009-11-19  8:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs; +Cc: 9fans

awk '{print substr($0, 1+length($1)+1)}'


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

* Re: [9fans] Q: awk omit cols
  2009-11-19  8:52 ` Russ Cox
@ 2009-11-19 10:17   ` Peter A. Cejchan
  2009-11-19 10:32     ` hugo rivera
  0 siblings, 1 reply; 5+ messages in thread
From: Peter A. Cejchan @ 2009-11-19 10:17 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Thu, Nov 19, 2009 at 9:52 AM, Russ Cox <rsc@swtch.com> wrote:
> awk '{print substr($0, 1+length($1)+1)}'
>

Big thank you, Russ, however, wouldn't it be smarter if we had some
kind of 'not' operator here...? Sometimes, especially when you write
the script by hand it is easier to delete few fields than to
explicitly write out all those remaining... IMHO...

++pac



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

* Re: [9fans] Q: awk omit cols
  2009-11-19 10:17   ` Peter A. Cejchan
@ 2009-11-19 10:32     ` hugo rivera
  2009-11-19 10:39       ` Peter A. Cejchan
  0 siblings, 1 reply; 5+ messages in thread
From: hugo rivera @ 2009-11-19 10:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I think
awk '{$1="";print}'
should do what you want, provided that you don't care about leading spaces.

2009/11/19 Peter A. Cejchan <tyapca7@gmail.com>:
> On Thu, Nov 19, 2009 at 9:52 AM, Russ Cox <rsc@swtch.com> wrote:
>> awk '{print substr($0, 1+length($1)+1)}'
>>
>
> Big thank you, Russ, however, wouldn't it be smarter if we had some
> kind of 'not' operator here...? Sometimes, especially when you write
> the script by hand it is easier to delete few fields than to
> explicitly write out all those remaining... IMHO...
>
> ++pac
>
>



--
Hugo



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

* Re: [9fans] Q: awk omit cols
  2009-11-19 10:32     ` hugo rivera
@ 2009-11-19 10:39       ` Peter A. Cejchan
  0 siblings, 0 replies; 5+ messages in thread
From: Peter A. Cejchan @ 2009-11-19 10:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> awk '{$1="";print}'
> should do what you want, provided that you don't care about leading spaces.


really, it works, I have still much to learn, thank you,
Peter, aka ++pac



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

end of thread, other threads:[~2009-11-19 10:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-19  8:34 [9fans] Q: awk omit cols Peter A. Cejchan
2009-11-19  8:52 ` Russ Cox
2009-11-19 10:17   ` Peter A. Cejchan
2009-11-19 10:32     ` hugo rivera
2009-11-19 10:39       ` Peter A. Cejchan

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).