awk problem
Posted in 2006
Henrique Lima wanted the REPLICATE name and QUEUE lines from cdr list repl printed on one line using awk. Jairo Gubler suggested using printf without newlines for both patterns, and another poster suggested saving the REPLICATE line in a variable and printing it with the QUEUE line. No confirmation was given.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Topics: General Discussion
Hi, I'd like to print in just one line the name and the queue number using this command: cdr list repl | awk ' { if ( $1 == "REPLICATE:" ) { print $0 } { if ( $1 == "QUEUE" ) { print $0 } } } ' I tried to use: cdr list repl | awk ' { if ( $1 == "REPLICATE:" ) { print $0 '\\\\c' } { if ( $1 == "QUEUE" ) { print $0 } } } ' but doesn't work tks henrique_lima_2000@yahoo.com.br henriquelima@uol.com.br _______________________________________________________ Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. Registre seu aparelho agora! http://br.mobile.yahoo.com/mailalertas/
cdr list repl | awk ' { if ( $1 == "REPLICATE:" ) { printf("%s", $0); } { if ($1 == "QUEUE" ) { printf(" %s\\ ", $0); } } } ' henrique li.... escreveu: >Hi, >I'd like to print in just one line the name and the queue number using this >command: >cdr list repl | awk ' { if ( $1 == "REPLICATE:" ) { print $0 } { if ( $1 == >"QUEUE" ) { print $0 } } } ' >I tried to use: >cdr list repl | awk ' { if ( $1 == "REPLICATE:" ) { print $0 '\\\\c' } { if ( >$1 == "QUEUE" ) { print $0 } } } ' >but doesn't work >tks > >henrique_lima_2000@yahoo.com.br >henriquelima@uol.com.br > >_______________________________________________________ >Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. >Registre seu aparelho agora! >http://br.mobile.yahoo.com/mailalertas/ > > >******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > -- *Jairo Gubler* /Analista de Sistemas //APL - IBD (Interfaces e Banco de Dados)/ *DÍGITRO TECNOLOGIA* *E-mail:* jairo.gubler@digitro.com.br <mailto:jairo.gubler@digitro.com.br> *Fone:* (48) 3281 7213 *Fax:* (48) 3281 7299 *Site:*www.digitro.com.br <http://www.portaldigitro.com.br>
Or: awk ' /REPLICATE/ { rep=3D$0 } /QUEUE/ { printf("%s %s\\ ", rep $0)}' cheers j. >From: Jairo Gubler <jairo.gubler@digitro.com.br> >Date: 2006/08/15 Tue AM 09:40:15 CDT >To: ids@iiug.org >Subject: Re: awk problem [7275] > >cdr list repl | awk ' { if ( $1 =3D=3D "REPLICATE:" ) { printf("%s", $0); = }=20 >{ if ($1 =3D=3D "QUEUE" ) { printf(" %s\\ ", $0); } } } '=20 > >henrique li.... escreveu:=20 > >>Hi,=20 >>I'd like to print in just one line the name and the queue number using th= is=20 >>command:=20 >>cdr list repl | awk ' { if ( $1 =3D=3D "REPLICATE:" ) { print $0 } { if (= $1 =3D=3D=20 >>"QUEUE" ) { print $0 } } } '=20 >>I tried to use:=20 >>cdr list repl | awk ' { if ( $1 =3D=3D "REPLICATE:" ) { print $0 '\\\\c' } {= if (=20 >>$1 =3D=3D "QUEUE" ) { print $0 } } } '=20 >>but doesn't work=20 >>tks=20 >>=20 >>henrique_lima_2000@yahoo.com.br=20 >>henriquelima@uol.com.br=20 >>=20 >>_______________________________________________________=20 >>Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular= .=20 >>Registre seu aparelho agora!=20 >>http://br.mobile.yahoo.com/mailalertas/=20 >>=20 >>=20 > >>*************************************************************************= ******=20 >> Forum Note: Use "Reply" to post a response in the discussion forum.=20 >>=20 >>=20 >>=20 >>=20 > >--=20 > >*Jairo Gubler*=20 >/Analista de Sistemas=20 >//APL - IBD (Interfaces e Banco de Dados)/=20 > >*D=CDGITRO TECNOLOGIA*=20 >*E-mail:* jairo.gubler@digitro.com.br <mailto:jairo.gubler@digitro.com.br>= =20 >*Fone:* (48) 3281 7213=20 >*Fax:* (48) 3281 7299=20 >*Site:*www.digitro.com.br <http://www.portaldigitro.com.br>=20 > > >**************************************************************************= *****=20 > Forum Note: Use "Reply" to post a response in the discussion forum.=20
Not sure where that 3D came from, it should not be in there. THank you webmail. j. >From: "vze2qjg5@ve...." <vze2qjg5@verizon.net> >Date: 2006/08/15 Tue AM 10:24:38 CDT >To: ids@iiug.org >Subject: Re: Re: awk problem [7276] > >Or: > >awk ' >/REPLICATE/ { rep=3D$0 } >/QUEUE/ { printf("%s %s\\ ", rep $0)}' > >cheers >j. > >>From: Jairo Gubler <jairo.gubler@digitro.com.br> >>Date: 2006/08/15 Tue AM 09:40:15 CDT >>To: ids@iiug.org >>Subject: Re: awk problem [7275] > >> >>cdr list repl | awk ' { if ( $1 =3D=3D "REPLICATE:" ) { printf("%s", $0); = >}=20 >>{ if ($1 =3D=3D "QUEUE" ) { printf(" %s\\ ", $0); } } } '=20 >> >>henrique li.... escreveu:=20 >> >>>Hi,=20 >>>I'd like to print in just one line the name and the queue number using th= >is=20 >>>command:=20 >>>cdr list repl | awk ' { if ( $1 =3D=3D "REPLICATE:" ) { print $0 } { if (= >$1 =3D=3D=20 >>>"QUEUE" ) { print $0 } } } '=20 >>>I tried to use:=20 >>>cdr list repl | awk ' { if ( $1 =3D=3D "REPLICATE:" ) { print $0 '\\\\c' } {= >if (=20 >>>$1 =3D=3D "QUEUE" ) { print $0 } } } '=20 >>>but doesn't work=20 >>>tks=20 >>>=20 >>>henrique_lima_2000@yahoo.com.br=20 >>>henriquelima@uol.com.br=20 >>>=20 >>>_______________________________________________________=20 >>>Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular= >..=20 >>>Registre seu aparelho agora!=20 >>>http://br.mobile.yahoo.com/mailalertas/=20 >>>=20 >>>=20 >> >>>*************************************************************************= >******=20 >>> Forum Note: Use "Reply" to post a response in the discussion forum.=20 >>>=20 >>>=20 >>>=20 >>>=20 >> >>--=20 >> >>*Jairo Gubler*=20 >>/Analista de Sistemas=20 >>//APL - IBD (Interfaces e Banco de Dados)/=20 >> >>*D=CDGITRO TECNOLOGIA*=20 >>*E-mail:* jairo.gubler@digitro.com.br <mailto:jairo.gubler@digitro.com.br>= >=20 >>*Fone:* (48) 3281 7213=20 >>*Fax:* (48) 3281 7299=20 >>*Site:*www.digitro.com.br <http://www.portaldigitro.com.br>=20 >> >> >>**************************************************************************= >*****=20 >> Forum Note: Use "Reply" to post a response in the discussion forum.=20 > > >******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum.