On Sat, May 27, Volker Kuhlmann wrote:
> I don't think that awk allows a regex for field separation.
A Unix reference manual mentions that (original) awk uses Space
or Tab as the default field separator and a single character if
the option -Fc is used.
--
keith.
On Sat, May 27, Hadley Rich wrote:
> I must play with awk some more.
explaination of some syntax in the awk/gawk manual is not
always obvious but the awk/gawk gurus on news://comp.lang.awk
will clarify how it is used if google fails. An active newgroup.
---
keith
> 'awk' accepts an "array" of field separators -F'[fsfsfs]' between square
> brackets so the required field $12 can be printed out. Not mentioned in the
> manual.
In the interest of portability awareness, let me be anally correct. I
don't think that awk allows a regex for field separation. Howev
On Saturday 27 May 2006 16:07, Keith McGavin wrote:
> 'awk' accepts an "array" of field separators -F'[fsfsfs]' between square
> brackets so the required field $12 can be printed out. Not mentioned in the
> manual.
>
> echo $THAT_LINE | awk -F'[,:]' '{print $12}'
Nice, I would say that's a winner.
On Fri, May 26, 2006 at 11:29:54AM, Nick Rout wrote:
> what is the best way to parse out the first load average figure, ie in
> this case 18.73
'awk' accepts an "array" of field separators -F'[fsfsfs]' between square
brackets so the required field $12 can be printed out. Not mentioned in the
man
On Fri, 26 May 2006 14:07:17 +1200
Nick Rout <[EMAIL PROTECTED]> wrote:
>
> On Fri, 26 May 2006 12:04:48 +1200
> Hadley Rich wrote:
>
> > On Friday 26 May 2006 11:29, Nick Rout wrote:
> > > given this string (all one line):
> > >
> > > Tracker Load: (9 %) > > style='padding: 0px; background-imag
On Friday 26 May 2006 14:07, Nick Rout wrote:
> yes that works thanks. I think I am right in saying that the sed part
> cuts out everything up to the words "load average:" and the cut part
> then takes up until (but not including) the comma.
Correct!
--
CS
On Fri, 26 May 2006 12:04:48 +1200
Hadley Rich wrote:
> On Friday 26 May 2006 11:29, Nick Rout wrote:
> > given this string (all one line):
> >
> > Tracker Load: (9 %) > style='padding: 0px; background-image: url(pic/loadbarbg.gif);
> > background-repeat: repeat-x'> > src="/pic/loadbargreen.gif"
> what is the best way to parse out the first load average figure, ie in
> this case 18.73
The best way is to get someone else to do it for you and guarantee it will
work.
In Python (if foo is your string):
load_average= float(foo.split('load average: ')[1].split(',')[0])
But it depends what l
> given this string (all one line):
>
> Tracker Load: (9 %) style='padding: 0px; background-image: url(pic/loadbarbg.gif);
> background-repeat: repeat-x'> src="/pic/loadbargreen.gif" alt='9%'>18:25:15 up 2 days,
> 23:44, 1 user, load average: 18.73, 20.96, 27.06
>
> what is the best way to p
On May 26, 2006, at 11:29 AM, Nick Rout wrote:
given this string (all one line):
Tracker Load: (9 %)style='padding: 0px; background-image: url(pic/loadbarbg.gif);
background-repeat: repeat-x'>18:25:15 up 2 days,
23:44, 1 user, load average: 18.73, 20.96, 27.06table>
what is the best wa
On Friday 26 May 2006 11:29, Nick Rout wrote:
> given this string (all one line):
>
> Tracker Load: (9 %) style='padding: 0px; background-image: url(pic/loadbarbg.gif);
> background-repeat: repeat-x'> src="/pic/loadbargreen.gif" alt='9%'>18:25:15 up 2 days,
> 23:44, 1 user, load average: 18.73,
Using which language?
Also, does anyone else find it odd that the line has one and 2
s?
Is there another further up?
Cheers,
Carl.
On 26/05/06, Nick Rout <[EMAIL PROTECTED]> wrote:
given this string (all one line):
Tracker Load: (9 %)18:25:15
up 2 days, 23:44, 1 user, load average: 18.7
given this string (all one line):
Tracker Load: (9 %)18:25:15 up 2 days, 23:44, 1 user, load average:
18.73, 20.96, 27.06
what is the best way to parse out the first load average figure, ie in
this case 18.73
--
Nick Rout <[EMAIL PROTECTED]>
Jamie Dobbs wrote:
I am trying to parse my mail log files to find out the number of messages
received per day and the total size of the messages received.
The format of the log files is:
From x Fri Oct 28 14:25:12 2005
Subject: FW: Emailing: super_cop_1_.wmv
Folder: ~/Maildir/new/1130
I am trying to parse my mail log files to find out the number of messages
received per day and the total size of the messages received.
The format of the log files is:
>From x Fri Oct 28 14:25:12 2005
Subject: FW: Emailing: super_cop_1_.wmv
Folder: ~/Maildir/new/1130462726.5627_0.xxx
On Fri, Apr 05, 2002 at 05:03:24PM +1200, Wayne Rooney wrote:
> From: Nick Rout <[EMAIL PROTECTED]>
> >I have a string like postfix/smtpd[25532]: I want to cut it off at the
> >[ so I end up with postfix/smtpd
> >
> For a fixed length string try
>
> echo postfix/smtpd[25532] | cut -c 1-13
Actu
-Original Message-
From: Nick Rout <[EMAIL PROTECTED]>
To: CLUG <[EMAIL PROTECTED]>
Date: Friday, April 05, 2002 4:39 PM
Subject: parsing
>I have a string like postfix/smtpd[25532]: I want to cut it off at the
>[ so I end up with postfix/smtpd
>
>how do
what is wrong with
sed 's/\[.*\]//g' textfile
-Original Message-
From: Jeremy Bertenshaw [mailto:[EMAIL PROTECTED]]
Sent: Friday, 5 April 2002 4:55 p.m.
To: Nick Rout; CLUG
Subject: Re: parsing
cat textfile | sed 's/\[.*\]//g'
:-)
jeremyb.
> From: Nick
> I have a string like postfix/smtpd[25532]: I want to cut it off at the
> [ so I end up with postfix/smtpd
sed 's/\[.*$//'(dump everything after first [ on line)
Volker
--
Volker Kuhlmann, list0570 at paradise dot net dot nz
http://volker.orcon.net.nz/ Please do not CC list
Or echo the string etc.. ;-)
> From: Jeremy Bertenshaw <[EMAIL PROTECTED]>
> Date: 2002/04/05 Fri PM 04:55:18 GMT+12:00
> To: Nick Rout <[EMAIL PROTECTED]>, CLUG <[EMAIL PROTECTED]>
> Subject: Re: parsing
>
> cat textfile | sed 's/\[.*\]//g'
cat textfile | sed 's/\[.*\]//g'
:-)
jeremyb.
> From: Nick Rout <[EMAIL PROTECTED]>
> Date: 2002/04/05 Fri PM 04:39:28 GMT+12:00
> To: CLUG <[EMAIL PROTECTED]>
> Subject: parsing
>
> I have a string like postfix/smtpd[25532]: I want to cut it off a
I have a string like postfix/smtpd[25532]: I want to cut it off at the
[ so I end up with postfix/smtpd
how do i do it?
--
Nick Rout <[EMAIL PROTECTED]>
23 matches
Mail list logo