Re: Simple awk question

2008-06-02 Thread Axel Schlicht
kj wrote: But I cannot find it in my awk book (O'Reilly's sed&awk). I'm trying to make three columns out of a postfix mail log. Queue ID, From address, and remote server response for certain situations (it's already grepped down to that). awk '{print $7" "$6" "$17}' $17 is the first word

Re: [OT] Re: Simple awk question

2008-05-31 Thread Andrew Sackville-West
On Sat, May 31, 2008 at 04:45:25PM +0200, Florian Kulzer wrote: > On Fri, May 30, 2008 at 18:13:30 -0700, Andrew Sackville-West wrote: > > On Fri, May 30, 2008 at 10:06:48AM +0100, John Allen wrote: > > ... > > > > > > > Here is some sample Perl. > > > > ...must ...not ...look... > > > > > > >

[OT] Re: Simple awk question

2008-05-31 Thread Florian Kulzer
On Fri, May 30, 2008 at 18:13:30 -0700, Andrew Sackville-West wrote: > On Fri, May 30, 2008 at 10:06:48AM +0100, John Allen wrote: > ... > > > > Here is some sample Perl. > > ...must ...not ...look... > > > > > grep bounced /var/log/mail.log | perl -p -e 's|\w+ \w+ \w+ \w+ \w+ \w+ > > (\w+) (\

Re: Simple awk question

2008-05-30 Thread Andrew Sackville-West
On Fri, May 30, 2008 at 10:06:48AM +0100, John Allen wrote: ... > Here is some sample Perl. ...must ...not ...look... > > grep bounced /var/log/mail.log | perl -p -e 's|\w+ \w+ \w+ \w+ \w+ \w+ (\w+) > (\w+) \w+ \w+ \w+ \w+ \w+ \w+ \w+ \w+ (.*)|\2 \1 \3|g' ACK! now my eyes are bleeding again..

Re: Simple awk question

2008-05-30 Thread Javier Barroso
On Fri, May 30, 2008 at 11:06 AM, John Allen <[EMAIL PROTECTED]> wrote: > Here is some sample Perl. > > grep bounced /var/log/mail.log | perl -p -e 's|\w+ \w+ \w+ \w+ \w+ \w+ > (\w+) (\w+) \w+ \w+ \w+ \w+ \w+ \w+ \w+ \w+ (.*)|\2 \1 \3|g' > Note about you could resume this regex with {} feature:

Re: Simple awk question

2008-05-30 Thread John Allen
Alfredo Finelli wrote: On Thursday 29 May 2008 19:44, kj wrote: [...] I'm trying to make three columns out of a postfix mail log. Queue ID, From address, and remote server response for certain situations (it's already grepped down to that). awk '{print $7" "$6" "$17}' $17 is the fir

Re: Simple awk question

2008-05-29 Thread Alfredo Finelli
On Thursday 29 May 2008 19:44, kj wrote: > [...] > >> I'm trying to make three columns out of a postfix mail log. Queue > >> ID, From address, and remote server response for certain > >> situations (it's already grepped down to that). > >> > >> awk '{print $7" "$6" "$17}' > >> > >> $17 is the fir

Re: Simple awk question

2008-05-29 Thread kj
John Allen wrote: kj wrote: But I cannot find it in my awk book (O'Reilly's sed&awk). I'm trying to make three columns out of a postfix mail log. Queue ID, From address, and remote server response for certain situations (it's already grepped down to that). awk '{print $7" "$6" "$17}' $17

Re: Simple awk question

2008-05-29 Thread John Allen
kj wrote: But I cannot find it in my awk book (O'Reilly's sed&awk). I'm trying to make three columns out of a postfix mail log. Queue ID, From address, and remote server response for certain situations (it's already grepped down to that). awk '{print $7" "$6" "$17}' $17 is the first word