[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: only output the nth line

On Thursday 13 May 2010 10:49:22 Jozsi Vadkan wrote:
> 2010. 05. 12, szerda keltezéssel 12.25-kor Hugo Vanwoerkom ezt írta:
> > Jozsi Vadkan wrote:
> > > I have a file:
> > > And i want to only output the first, second, and fourth line to another
> > > file.
> >
> > hugo@debian:~$ sed -n '1,2p;4p' file.txt
> yes, that's the problem, it only outputs the first, second, and fourth
> line!

I think that perhaps there is some language barrier.

Your original post indicates that you want lines 1, 2, 4 and no others output.  
"i want only output the first, second, and fourth line"

Your most recent post says that is "the problem".  Which I infer means 
something you don't want.

Could you maybe rephrase the question, or at least be a bit more verbose?


If you want the output to go to a file try something like (sed -ne '1,2p;4p' 
"$input" > "$output").

Boyd Stephen Smith Jr.           	 ,= ,-_-. =.
bss@iguanasuicide.net            	((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy 	 `-'(. .)`-'
http://iguanasuicide.net/        	     \_/

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply to: