Parsing for certain lines.

L

Larry

Could anyone help me with parsing this file? All I need are the lines
beginning with Drive: c$ and the line beginning with [current drive]. I have
set this up using the 'for' command and feeding it with a list of our
servers. I just want the disk space numbers...

thx, L



File output begins with an empty line then the following text:

TreeSize Professional Report, Sunday, January 04, 2004
Drive: c$ on Server Purpose - Physical Location (hornet1)
[Current Drive] Size: 8197 MB Used: 3751 MB Free: 4446 MB
512 Bytes per Cluster (NTFS)

Name Size Allocated Files Wasted
% of Parent Last Change Last Access Compr. Owner
\\hornet1\c$ 3,763.1 MB 3,680.2 MB 20365 4.3 MB 100.0 % 1/4/2004
1/4/2004 2.2 % Administrators
[Files] 2,304.7 MB 2,304.7 MB 16 0.0 MB 61.2 % 1/4/2004 1/4/2004 0.0 %
Administrators
WINNT 752.9 MB 666.8 MB 6801 1.1 MB 20.0 % 1/4/2004 1/4/2004 11.4 %
Administrators
i386 322.1 MB 323.6 MB 5952 1.5 MB 8.6 % 6/19/2003 12/19/2003 0.0 %
Administrators
Program Files 320.1 MB 321.5 MB 6435 1.4 MB 8.5 % 1/4/2004 1/4/2004 0.0
% Administrators
Documents and Settings 35.1 MB 35.2 MB 525 0.1 MB 0.9 % 1/2/2004
1/4/2004 0.0 % Administrators
PNP 14.6 MB 14.7 MB 413 0.1 MB 0.4 % 12/19/2003 12/19/2003 0.0 %
Administrators
cmdcons 5.4 MB 5.5 MB 111 0.0 MB 0.1 % 12/19/2003 12/19/2003 0.0 %
Administrators
source 4.2 MB 4.2 MB 12 0.0 MB 0.1 % 7/23/2003 12/19/2003 0.0 %
Administrators
SETUP 3.5 MB 3.6 MB 80 0.0 MB 0.1 % 12/19/2003 12/19/2003 0.0 %
Administrators
Atjobs 0.5 MB 0.5 MB 12 0.0 MB 0.0 % 12/19/2003 1/4/2004 0.0 %
Administrators
temp 0.0 MB 0.0 MB 4 0.0 MB 0.0 % 12/19/2003 12/19/2003 0.0 %
Administrators
System Volume Information 0.0 MB 0.0 MB 1 0.0 MB 0.0 % 12/19/2003
12/19/2003 0.0 % Administrators
RECYCLER 0.0 MB 0.0 MB 3 0.0 MB 0.0 % 12/19/2003 12/19/2003 0.0 %
Administrators
 
P

Phil Robyn

Larry said:
Could anyone help me with parsing this file? All I need are the lines
beginning with Drive: c$ and the line beginning with [current drive]. I have
set this up using the 'for' command and feeding it with a list of our
servers. I just want the disk space numbers...

thx, L

findstr "Drive" c:\yourpath\yourfile
File output begins with an empty line then the following text:

TreeSize Professional Report, Sunday, January 04, 2004
Drive: c$ on Server Purpose - Physical Location (hornet1)
[Current Drive] Size: 8197 MB Used: 3751 MB Free: 4446 MB
512 Bytes per Cluster (NTFS)

Name Size Allocated Files Wasted
% of Parent Last Change Last Access Compr. Owner
\\hornet1\c$ 3,763.1 MB 3,680.2 MB 20365 4.3 MB 100.0 % 1/4/2004
1/4/2004 2.2 % Administrators
[Files] 2,304.7 MB 2,304.7 MB 16 0.0 MB 61.2 % 1/4/2004 1/4/2004 0.0 %
Administrators
WINNT 752.9 MB 666.8 MB 6801 1.1 MB 20.0 % 1/4/2004 1/4/2004 11.4 %
Administrators
i386 322.1 MB 323.6 MB 5952 1.5 MB 8.6 % 6/19/2003 12/19/2003 0.0 %
Administrators
Program Files 320.1 MB 321.5 MB 6435 1.4 MB 8.5 % 1/4/2004 1/4/2004 0.0
% Administrators
Documents and Settings 35.1 MB 35.2 MB 525 0.1 MB 0.9 % 1/2/2004
1/4/2004 0.0 % Administrators
PNP 14.6 MB 14.7 MB 413 0.1 MB 0.4 % 12/19/2003 12/19/2003 0.0 %
Administrators
cmdcons 5.4 MB 5.5 MB 111 0.0 MB 0.1 % 12/19/2003 12/19/2003 0.0 %
Administrators
source 4.2 MB 4.2 MB 12 0.0 MB 0.1 % 7/23/2003 12/19/2003 0.0 %
Administrators
SETUP 3.5 MB 3.6 MB 80 0.0 MB 0.1 % 12/19/2003 12/19/2003 0.0 %
Administrators
Atjobs 0.5 MB 0.5 MB 12 0.0 MB 0.0 % 12/19/2003 1/4/2004 0.0 %
Administrators
temp 0.0 MB 0.0 MB 4 0.0 MB 0.0 % 12/19/2003 12/19/2003 0.0 %
Administrators
System Volume Information 0.0 MB 0.0 MB 1 0.0 MB 0.0 % 12/19/2003
12/19/2003 0.0 % Administrators
RECYCLER 0.0 MB 0.0 MB 3 0.0 MB 0.0 % 12/19/2003 12/19/2003 0.0 %
Administrators
 
L

Larry

Phil, how do I get the line with drive and the one below it. Those two lines
have the meat of what I want to capture.

thx again, Larry
Phil Robyn said:
Larry said:
Could anyone help me with parsing this file? All I need are the lines
beginning with Drive: c$ and the line beginning with [current drive]. I have
set this up using the 'for' command and feeding it with a list of our
servers. I just want the disk space numbers...

thx, L

findstr "Drive" c:\yourpath\yourfile
File output begins with an empty line then the following text:

TreeSize Professional Report, Sunday, January 04, 2004
Drive: c$ on Server Purpose - Physical Location (hornet1)
[Current Drive] Size: 8197 MB Used: 3751 MB Free: 4446 MB
512 Bytes per Cluster (NTFS)

Name Size Allocated Files Wasted
% of Parent Last Change Last Access Compr. Owner
\\hornet1\c$ 3,763.1 MB 3,680.2 MB 20365 4.3 MB 100.0 % 1/4/2004
1/4/2004 2.2 % Administrators
[Files] 2,304.7 MB 2,304.7 MB 16 0.0 MB 61.2 % 1/4/2004 1/4/2004 0.0 %
Administrators
WINNT 752.9 MB 666.8 MB 6801 1.1 MB 20.0 % 1/4/2004 1/4/2004 11.4 %
Administrators
i386 322.1 MB 323.6 MB 5952 1.5 MB 8.6 % 6/19/2003 12/19/2003 0.0 %
Administrators
Program Files 320.1 MB 321.5 MB 6435 1.4 MB 8.5 % 1/4/2004 1/4/2004 0.0
% Administrators
Documents and Settings 35.1 MB 35.2 MB 525 0.1 MB 0.9 % 1/2/2004
1/4/2004 0.0 % Administrators
PNP 14.6 MB 14.7 MB 413 0.1 MB 0.4 % 12/19/2003 12/19/2003 0.0 %
Administrators
cmdcons 5.4 MB 5.5 MB 111 0.0 MB 0.1 % 12/19/2003 12/19/2003 0.0 %
Administrators
source 4.2 MB 4.2 MB 12 0.0 MB 0.1 % 7/23/2003 12/19/2003 0.0 %
Administrators
SETUP 3.5 MB 3.6 MB 80 0.0 MB 0.1 % 12/19/2003 12/19/2003 0.0 %
Administrators
Atjobs 0.5 MB 0.5 MB 12 0.0 MB 0.0 % 12/19/2003 1/4/2004 0.0 %
Administrators
temp 0.0 MB 0.0 MB 4 0.0 MB 0.0 % 12/19/2003 12/19/2003 0.0 %
Administrators
System Volume Information 0.0 MB 0.0 MB 1 0.0 MB 0.0 % 12/19/2003
12/19/2003 0.0 % Administrators
RECYCLER 0.0 MB 0.0 MB 3 0.0 MB 0.0 % 12/19/2003 12/19/2003 0.0 %
Administrators


--
Phil Robyn
Univ. of California, Berkeley

u n z i p m y a d d r e s s t o s e n d e - m a i l
 
J

Jerold Schulman

Create a text file call myargs.txt which contains:
Drive: c$
[Current Drive]

findstr /l //g:\myargpath\myargs.txt yourfilepath\yourfile




Phil, how do I get the line with drive and the one below it. Those two lines
have the meat of what I want to capture.

thx again, Larry
Phil Robyn said:
Larry said:
Could anyone help me with parsing this file? All I need are the lines
beginning with Drive: c$ and the line beginning with [current drive]. I have
set this up using the 'for' command and feeding it with a list of our
servers. I just want the disk space numbers...

thx, L

findstr "Drive" c:\yourpath\yourfile
File output begins with an empty line then the following text:

TreeSize Professional Report, Sunday, January 04, 2004
Drive: c$ on Server Purpose - Physical Location (hornet1)
[Current Drive] Size: 8197 MB Used: 3751 MB Free: 4446 MB
512 Bytes per Cluster (NTFS)

Name Size Allocated Files Wasted
% of Parent Last Change Last Access Compr. Owner
\\hornet1\c$ 3,763.1 MB 3,680.2 MB 20365 4.3 MB 100.0 % 1/4/2004
1/4/2004 2.2 % Administrators
[Files] 2,304.7 MB 2,304.7 MB 16 0.0 MB 61.2 % 1/4/2004 1/4/2004 0.0 %
Administrators
WINNT 752.9 MB 666.8 MB 6801 1.1 MB 20.0 % 1/4/2004 1/4/2004 11.4 %
Administrators
i386 322.1 MB 323.6 MB 5952 1.5 MB 8.6 % 6/19/2003 12/19/2003 0.0 %
Administrators
Program Files 320.1 MB 321.5 MB 6435 1.4 MB 8.5 % 1/4/2004 1/4/2004 0.0
% Administrators
Documents and Settings 35.1 MB 35.2 MB 525 0.1 MB 0.9 % 1/2/2004
1/4/2004 0.0 % Administrators
PNP 14.6 MB 14.7 MB 413 0.1 MB 0.4 % 12/19/2003 12/19/2003 0.0 %
Administrators
cmdcons 5.4 MB 5.5 MB 111 0.0 MB 0.1 % 12/19/2003 12/19/2003 0.0 %
Administrators
source 4.2 MB 4.2 MB 12 0.0 MB 0.1 % 7/23/2003 12/19/2003 0.0 %
Administrators
SETUP 3.5 MB 3.6 MB 80 0.0 MB 0.1 % 12/19/2003 12/19/2003 0.0 %
Administrators
Atjobs 0.5 MB 0.5 MB 12 0.0 MB 0.0 % 12/19/2003 1/4/2004 0.0 %
Administrators
temp 0.0 MB 0.0 MB 4 0.0 MB 0.0 % 12/19/2003 12/19/2003 0.0 %
Administrators
System Volume Information 0.0 MB 0.0 MB 1 0.0 MB 0.0 % 12/19/2003
12/19/2003 0.0 % Administrators
RECYCLER 0.0 MB 0.0 MB 3 0.0 MB 0.0 % 12/19/2003 12/19/2003 0.0 %
Administrators


--
Phil Robyn
Univ. of California, Berkeley

u n z i p m y a d d r e s s t o s e n d e - m a i l


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top