Re: parsing

2006-05-27 Thread Keith McGavin
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

Re: parsing

2006-05-27 Thread Keith McGavin
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.

Re: parsing

2006-05-26 Thread Keith McGavin
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

Re: parsing

2006-05-26 Thread Hadley Rich
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

Re: parsing

2006-05-26 Thread Volker Kuhlmann
'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,

parsing

2006-05-25 Thread Nick Rout
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,

Re: parsing

2006-05-25 Thread Carl Cerecke
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

Re: parsing

2006-05-25 Thread Hadley Rich
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

Re: parsing

2006-05-25 Thread David Mann
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

Re: parsing

2006-05-25 Thread Volker Kuhlmann
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

Re: parsing

2006-05-25 Thread Andrew Errington
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

Re: parsing

2006-05-25 Thread Nick Rout
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:

Re: parsing

2006-05-25 Thread Christopher Sawtell
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

Re: parsing

2006-05-25 Thread Steve Holdoway
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

Re: Parsing Mail log files

2005-10-28 Thread Daniel
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:

Parsing Mail log files

2005-10-27 Thread Jamie Dobbs
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

parsing

2002-04-04 Thread Nick Rout
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]

Re: parsing

2002-04-04 Thread Jeremy Bertenshaw
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

Re: parsing

2002-04-04 Thread Volker Kuhlmann
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

Re: parsing

2002-04-04 Thread Wayne Rooney
-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

Re: parsing

2002-04-04 Thread Jim Cheetham
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