9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] sed
@ 2001-01-04 18:39 rog
  0 siblings, 0 replies; 8+ messages in thread
From: rog @ 2001-01-04 18:39 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 78 bytes --]

i always used:
	grep -n '^' file1 > file2

but that's just me, i guess.


[-- Attachment #2: Type: message/rfc822, Size: 1893 bytes --]

To: cse.psu.edu!9fans
Subject: Re: [9fans] sed
Date: Thu, 4 Jan 2001 09:21:58 -0800
Message-ID: <10101040921.ZM156152@marvin>

> Is there a different way to do the following under Plan9?
> 	sed = file1|sed 'N;s/\n/\	/' >file2
> 		or
> 	cat -n file1 >file2
Does
	awk '{print NR "\t" $0}' file1 >file2
not work?

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

* Re: [9fans] sed
@ 2001-01-04 18:10 rob pike
  0 siblings, 0 replies; 8+ messages in thread
From: rob pike @ 2001-01-04 18:10 UTC (permalink / raw)
  To: 9fans

Another of my methods was
	grep -n '^' file1 | sed 's/:/	/' > file2



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

* Re: [9fans] sed
@ 2001-01-04 17:58 nigel
  0 siblings, 0 replies; 8+ messages in thread
From: nigel @ 2001-01-04 17:58 UTC (permalink / raw)
  To: 9fans

Good if you want colons!

> i always used:
> 	grep -n '^' file1 > file2
> 
> but that's just me, i guess.



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

* Re: [9fans] sed
@ 2001-01-04 17:28 rob pike
  0 siblings, 0 replies; 8+ messages in thread
From: rob pike @ 2001-01-04 17:28 UTC (permalink / raw)
  To: 9fans

I had a list of several ways to do it, of which the second was
	awk '{print NR "\t" $0}' file1 >file2
but decided the shortest was also the most straightforward.
	pr -t -n file1 > file2

-rob



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

* Re: [9fans] sed
       [not found] ` <wstan@localhostnl.demon.nl>
@ 2001-01-04 17:21   ` Tom Duff
  0 siblings, 0 replies; 8+ messages in thread
From: Tom Duff @ 2001-01-04 17:21 UTC (permalink / raw)
  To: 9fans

> Is there a different way to do the following under Plan9?
> 	sed = file1|sed 'N;s/\n/\	/' >file2
> 		or
> 	cat -n file1 >file2
Does
	awk '{print NR "\t" $0}' file1 >file2
not work?


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

* [9fans] sed
@ 2001-01-04  8:45 William Staniewicz
       [not found] ` <wstan@localhostnl.demon.nl>
  0 siblings, 1 reply; 8+ messages in thread
From: William Staniewicz @ 2001-01-04  8:45 UTC (permalink / raw)
  To: 9fans

Is there a different way to do the following under Plan9?

	sed = file1|sed 'N;s/\n/\	/' >file2

		or

	cat -n file1 >file2

Both would insert line numbers in file2 from file1.
Sorry if this is a basic question.

Bill



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

* Re: [9fans] sed
@ 2001-01-04  3:15 jmk
  0 siblings, 0 replies; 8+ messages in thread
From: jmk @ 2001-01-04  3:15 UTC (permalink / raw)
  To: 9fans

"rob pike" <rob@plan9.bell-labs.com>:

	pr -t -n file1 > file2

make sure you use
	pr -t -n file1 > file2
	pr -n -t file1 > file2
	pr -tn file1 > file2
but not
	pr -nt file1 > file2


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

* Re: [9fans] sed
@ 2001-01-04  2:51 rob pike
  0 siblings, 0 replies; 8+ messages in thread
From: rob pike @ 2001-01-04  2:51 UTC (permalink / raw)
  To: 9fans

	pr -t -n file1 > file2



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

end of thread, other threads:[~2001-01-04 18:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-04 18:39 [9fans] sed rog
  -- strict thread matches above, loose matches on Subject: below --
2001-01-04 18:10 rob pike
2001-01-04 17:58 nigel
2001-01-04 17:28 rob pike
2001-01-04  8:45 William Staniewicz
     [not found] ` <wstan@localhostnl.demon.nl>
2001-01-04 17:21   ` Tom Duff
2001-01-04  3:15 jmk
2001-01-04  2:51 rob pike

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