For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > March 2004 > Simple File Parse









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Simple File Parse
nick

2004-03-31, 5:37 pm

I recently downloaded Doug Knox's vb script which defrags all drives
in windows xp. This script creates ‘defragreport.txt' on the first
drive it finds. My question is how can I pull information from this
‘defragreport.txt', which will reside on 50-60 pc's, and create a
single file (.xls or .csv) which will be checked to make sure
everything ran properly? In the file I would like to have the name of
the computer from which the ‘defragreport.txt' came and the necessary
information from the .txt file.

The ‘defragreport.txt' looks as follows:



3/25/2004

10:06:11 AM

Drive C: Defrag completed successfully

Drive D: Defrag completed successfully

Drive E: Defrag completed successfully



Any help would be greatly appreciated.
John Bokma

2004-03-31, 6:40 pm

nick wrote:

> I recently downloaded Doug Knox's vb script which defrags all drives
> in windows xp.


Is this really needed with NTFS? And why on earth VB script? :-D

> This script creates ‘defragreport.txt' on the first
> drive it finds. My question is how can I pull information from this
> ‘defragreport.txt', which will reside on 50-60 pc's, and create a
> single file (.xls or .csv) which will be checked to make sure
> everything ran properly? In the file I would like to have the name of
> the computer from which the ‘defragreport.txt' came and the necessary
> information from the .txt file.
>
> The ‘defragreport.txt' looks as follows:
>
> 3/25/2004
>
> 10:06:11 AM
>
> Drive C: Defrag completed successfully
>
> Drive D: Defrag completed successfully
>
> Drive E: Defrag completed successfully
>
> Any help would be greatly appreciated.


First there must be a way that each report gets on one machine. You
could decide to share each drive as read only.. but... that sounds a bit
unsecure to me. Maybe let each computer upload the report to a central
computer? The hostname can be used to identify which report belongs to
which computer. No need to merge all in one file if checking is all you
want. You just have to look at each file for a not completed
successfully message. If you decide for the "each computer uploads his
report", you can maybe let each computer check its report, and reports
only if an error occured, to a central computer. Maybe using a webserver
on the central computer, and POSTing the problem?

Anyway, the main problem is not the glueing together, but how to get the
reports on one computer :-D

--
John personal page: http://johnbokma.com/

Freelance Perl / Java developer available - http://castleamber.com/
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com