Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: parsing out...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 2164 of 2317
Post > Topic >>

Re: parsing output for Excel

by Ed Morton <morton@[EMAIL PROTECTED] > Feb 13, 2008 at 09:09 AM

On 2/13/2008 8:45 AM, dwcasey@[EMAIL PROTECTED]
 wrote:
> I run a script that does some checks on many, many servers.
> 
> If an error condition exists, I write out to a file ERR: with the
> issue that was found.  I'm wanting to be able to create some format
> from this that will go into a spreadsheet.  Really just looking for
> ideas on what would be a good way to parse it that would be acceptable
> for Excel.  Like maybe grab a unique servername and all it's issues?
> 
> This is a cat *.out of the servers.out file created by my script.
> 
> srv.srv01.out:ERR: dummy not found for LTAPEDEV in pri srv01
> srv.srv01.out:ERR: Found 127.0.0.1 on TSM Server in resolv.conf for
> TSM srv01
> srv.srv02.out:ERR: dummy not found for LTAPEDEV in pri srv02
> srv.srv02.out:ERR: directory /dummy not found on filesystem in pri
> srv02
> srv.srv02.out:ERR: directory /dummy not found on filesystem in bkp
> srv02
> srv.srv02.out:ERR: Found 127.0.0.1 on TSM Server in resolv.conf for
> TSM srv02
> srv.srv03.out:ERR: dummy not found for LTAPEDEV in pri srv03
> srv.srv03.out:ERR: directory /dummy not found on filesystem in pri
> srv03
> srv.srv03.out:ERR: directory /dummy not found on filesystem in bkp
> srv03
> srv.srv03.out:ERR: Found 127.0.0.1 on TSM Server in resolv.conf for
> TSM srv03

I'd just replace "ERR: " with the FILENAME followed by a tab:

awk 'sub(/ERR: /,FILENAME"\t")1' *.out > err.txt

then open err.txt with Excel as tab-separated text.

	Ed.
 




 2 Posts in Topic:
parsing output for Excel
dwcasey@[EMAIL PROTECTED]  2008-02-13 06:45:35 
Re: parsing output for Excel
Ed Morton <morton@[EMA  2008-02-13 09:09:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 2:36:53 CDT 2008.