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
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 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
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. I
'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. However,
given this string (all one line):
Tracker Load: (9 %)table class=main border=0 width=400trtd style='padding:
0px; background-image: url(pic/loadbarbg.gif); background-repeat:
repeat-x'img height=15 width=36 src=/pic/loadbargreen.gif
alt='9%'/td/tr/table18:25:15 up 2 days, 23:44, 1 user,
Using which language?
Also, does anyone else find it odd that the line has one table and 2
/tables?
Is there another table further up?
Cheers,
Carl.
On 26/05/06, Nick Rout [EMAIL PROTECTED] wrote:
given this string (all one line):
Tracker Load: (9 %)table class=main border=0 width=400trtd
On Friday 26 May 2006 11:29, Nick Rout wrote:
given this string (all one line):
Tracker Load: (9 %)table class=main border=0 width=400trtd
style='padding: 0px; background-image: url(pic/loadbarbg.gif);
background-repeat: repeat-x'img height=15 width=36
src=/pic/loadbargreen.gif
On May 26, 2006, at 11:29 AM, Nick Rout wrote:
given this string (all one line):
Tracker Load: (9 %)table class=main border=0 width=400trtd
style='padding: 0px; background-image: url(pic/loadbarbg.gif);
background-repeat: repeat-x'img height=15 width=36 src=/pic/
loadbargreen.gif
given this string (all one line):
Tracker Load: (9 %)table class=main border=0 width=400trtd
style='padding: 0px; background-image: url(pic/loadbarbg.gif);
background-repeat: repeat-x'img height=15 width=36
src=/pic/loadbargreen.gif alt='9%'/td/tr/table18:25:15 up 2 days,
23:44, 1
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
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 %)table class=main border=0 width=400trtd
style='padding: 0px; background-image: url(pic/loadbarbg.gif);
background-repeat:
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 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 %)table class=main border=0 width=400trtd
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:
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
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]
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 at the
[ so I end up with postfix/smtpd
how do i
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
-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 i do it?
--
Nick Rout [EMAIL
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
Actually, cut
21 matches
Mail list logo