Iteration through a text file.

marcus mvs2 at linuxmail.org
Thu Jun 5 16:24:09 CEST 2003


Peter Hansen <peter at engcorp.com> wrote in message news:<3EDE34AA.C8247DA0 at engcorp.com>...

> 
> You might want to post simple examples of the input you expect to
> find and the output you want, so we don't have to reverse engineer
> your intent from the code or the summary description.

OK, 

Here is what part of the file looks like:


 
 
 
 
Server, server123 
Uptime Report for: \\10.xxx.xx.xx

Current OS: Microsoft Windows 2000, Service Pack 2, Multiprocessor
Free.
Time Zone: Central Standard Time

System Events as of 3/31/2003 8:29:50 AM:

Date:      Time:        Event:               Comment:
---------- -----------  ------------------- 
-----------------------------------
 3/26/2003  1:17:25 AM  Abnormal Shutdown    Prior uptime:12137d
7h:17m:25s
 3/26/2003  9:02:48 AM  Boot                 Prior downtime:0d
7h:45m:23s

Current System Uptime: 4 day(s), 23 hour(s), 27 minute(s), 53
second(s)


--------------------------------------------------------------------------------

Since 3/24/2003: (Last 7 Days)

           System Availability: 95.6054%
                  Total Uptime: 7d 0h:44m:27s
                Total Downtime: 0d 7h:45m:23s
                 Total Reboots: 1
     Mean Time Between Reboots: 7.35 days
             Total Bluescreens: 0
 
 
 
 
Server, calltaker8 
UPTIME was unable to connect to host: \\10.xxx.xx.xx 
 
 
 
 
Server, superserver1
UPTIME was unable to connect to host: \\10.xxx.xx.xx
 
 
 
 
Server, Dabrain1
UPTIME was unable to connect to host: \\10.xxx.xx.xx
 
 
 
 
Server, NEPTUNE
Uptime Report for: \\10.xxx.xx.xx

OS: Windows NT 4.0 (Build 1381), Service Pack 6, Uniprocessor Free.
Time Zone: Central Standard Time

System Events as of 3/31/2003 8:29:51 AM:

Date:      Time:        Event:               Comment:
---------- -----------  ------------------- 
-----------------------------------

Current System Uptime: 75 day(s), 4 hour(s), 7 minute(s), 19 second(s)


--------------------------------------------------------------------------------

Since 3/24/2003: (Last 7 Days)

           System Availability: 100.0000%
                  Total Uptime: 6d 14h:46m:22s
                Total Downtime: 0d 0h:0m:0s
                 Total Reboots: 0
             Total Bluescreens: 0
 



******************

I'm looking to extract server name, and availablity time.  If there is
no availablity time, I'll write out "N/A".




More information about the Python-list mailing list