From: Jozsi Vadkan on
yes, that's the problem, it only outputs the first, second, and fourth
line!

ii sed 4.1.5-6
The GNU sed stream editor

Debian Lenny

2010. 05. 12, szerda keltezéssel 12.25-kor Hugo Vanwoerkom ezt írta:
> Jozsi Vadkan wrote:
> > I have a file:
> >
> <snip>
> >
> >
> > And i want to only output the first, second, and fourth line to another
> > file.
> >
> > The:
> >
> > sed -n '1,2p;4p' file.txt
> >
>
> hugo(a)debian:~$ sed -n '1,2p;4p' file.txt
> daemon
> 1):
> 0
>
> ii sed 4.1.5-8 The GNU sed stream editor
>
> Hugo
>
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/1273765762.3998.1.camel(a)localhost
From: Boyd Stephen Smith Jr. on
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(a)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(a)iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
From: Jozsi Vadkan on
oops, typo

I wanted to say that it only outputs the first, second, and fourht line
_once_

so the 8th, etc lines are not in the output

sorry:D

2010. 05. 13, csütörtök keltezéssel 11.04-kor Boyd Stephen Smith Jr. ezt
írta:
> 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(a)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").
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/1273768493.3998.4.camel(a)localhost
From: Sjoerd Hardeman on
Op 13-05-10 18:34, Jozsi Vadkan schreef:
>> 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?
> oops, typo
>
> I wanted to say that it only outputs the first, second, and fourht line
> _once_
>
> so the 8th, etc lines are not in the output
Perhaps you can write down again what you *do* want to achieve? I'm not
understanding it yet, and maybe I'm not alone.

Sjoerd
PS. Can you please bottom-post when replying? That's the preferred way
of replying on this list

From: Boyd Stephen Smith Jr. on
TOFU fixed. Please trim your replies to only the required context.

On Thursday 13 May 2010 11:34:53 Jozsi Vadkan wrote:
> 2010. 05. 13, csütörtök keltezéssel 11.04-kor Boyd Stephen Smith Jr. ezt
>
> írta:
> > 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(a)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.
>
> oops, typo
>
> I wanted to say that it only outputs the first, second, and fourht line
> _once_
>
> so the 8th, etc lines are not in the output

Yes. You didn't tell sed to do that. You also didn't tell *us* you wanted
that. The key part is "etc." (i.e. "and others"), you never indicated you
wanted anything other than the 1st, 2nd, and 4th lines.

So, what you want is every Nth line whenever N is a power of two? Sounds like
homework. I already did my homework and have my degree; I don't intend to do
yours.
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss(a)iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/