Has anyone had to do any parsing of a directory listing (dir) output file?
What I’m after is a way to translate a dir that looks like this:
Volume in drive D is Data
Volume Serial Number is CC0B-BE98
Directory of D:example
21/02/2002 11:39 .
21/02/2002 11:39 ..
21/02/2002 11:42 examplesub1
21/02/2002 11:43 examplesub2
21/02/2002 11:38 0 main.txt
1 File(s) 0 bytes
Directory of D:exampleexamplesub1
21/02/2002 11:42 .
21/02/2002 11:42 ..
21/02/2002 11:40 examplesubsub1
21/02/2002 11:39 0 subtext1.txt
1 File(s) 0 bytes
Directory of D:exampleexamplesub1examplesubsub1
21/02/2002 11:40 .
21/02/2002 11:40 ..
21/02/2002 11:40 0 random1.txt
21/02/2002 11:40 0 random2.txt
21/02/2002 11:39 0 subsubtext1.txt
3 File(s) 0 bytes
Directory of D:exampleexamplesub2
21/02/2002 11:43 .
21/02/2002 11:43 ..
21/02/2002 11:40 0 what1.txt
21/02/2002 11:39 0 what2.txt
2 File(s) 0 bytes
Total Files Listed:
7 File(s) 0 bytes
11 Dir(s) 2,221,850,624 bytes free
into something like this:
Path date size type
D:examplemain.txt 21/02/2002 11:38 0 txt
D:exampleexamplesub1subtext1.txt 21/02/2002 11:40 0 txt
D:exampleexamplesub1examplesubsub1random1.txt 21/02/2002 11:40 0 txt
etc….
Sorry about the formatting. the idea is to throw the result into a table, and do some exception reporting on large variations in file size over periods of time.
The dir listing is emailed to me, so I can’t do any fancy filesystem stuff.
just wondered if anyone had anything even close, so I wouldn’t have write the whole thing…
Any help gratefully accepted.
Cheers
Jim