Hi All,
I have a number of text files which are the results of a dir of certain hard drives in the system.
What I would like to do is strip off the amount of bytes used and the amount of bytes free for each drive.
Basically what I need to be able to do is open each of these files and navigate down to the lines that say "bytes" and bytes free.
Examples of the end of each file is as follows:-
Total Files Listed:
85 File(s) 248,582,163,171 bytes
3 Dir(s) 1,399,914,496 bytes free
---
771 File(s) 249,402,397,641 bytes
2 Dir(s) 576,229,376 bytes free
---
Total Files Listed:
44039 File(s) 188,416,106,965 bytes
1149 Dir(s) 61,402,812,416 bytes free
etc etc etc
Once I have got these lines I would then want to strip out the values:-
248,582,163,171
1,399,914,496
249,402,397,641
576,229,376
etc etc
I have tried but I do not know how to do this.
Here is a snippet of code I am using to read each file and then manipulating each string and writing it back to another file, however I have no idea how to read a file and search for a word and then use that record.
aax = rst![Drive Name] ' Get record from table
dstr = con1 & "\" & aax & ".txt" ' Set locatiion string for text file
Set f = fs1.OpenTextFile(dstr, 1) ' open input file
Do While Not f.atendofstream
' read the input text file
ab = f.ReadLine
a.Writeline (ab)
End If
Loop
Any help or pointers would be very gratefully received
many thanks
James
I have a number of text files which are the results of a dir of certain hard drives in the system.
What I would like to do is strip off the amount of bytes used and the amount of bytes free for each drive.
Basically what I need to be able to do is open each of these files and navigate down to the lines that say "bytes" and bytes free.
Examples of the end of each file is as follows:-
Total Files Listed:
85 File(s) 248,582,163,171 bytes
3 Dir(s) 1,399,914,496 bytes free
---
771 File(s) 249,402,397,641 bytes
2 Dir(s) 576,229,376 bytes free
---
Total Files Listed:
44039 File(s) 188,416,106,965 bytes
1149 Dir(s) 61,402,812,416 bytes free
etc etc etc
Once I have got these lines I would then want to strip out the values:-
248,582,163,171
1,399,914,496
249,402,397,641
576,229,376
etc etc
I have tried but I do not know how to do this.
Here is a snippet of code I am using to read each file and then manipulating each string and writing it back to another file, however I have no idea how to read a file and search for a word and then use that record.
aax = rst![Drive Name] ' Get record from table
dstr = con1 & "\" & aax & ".txt" ' Set locatiion string for text file
Set f = fs1.OpenTextFile(dstr, 1) ' open input file
Do While Not f.atendofstream
' read the input text file
ab = f.ReadLine
a.Writeline (ab)
End If
Loop
Any help or pointers would be very gratefully received
many thanks
James