• Parse dir output (any)

    Author
    Topic
    #367137

    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

    Viewing 2 reply threads
    Author
    Replies
    • #571639

      At least use FSO to manipulate your dir output file. You’ll have lots more fun than if you use Open #

      • #571651

        Yeah, thanks Kevin, I promise. But I don’t want to do it if it’s been done!

    • #571666

      > The dir listing is emailed to me, so I can’t do any fancy filesystem stuff.

      Perhaps, though, you could prevail on the other person to run a .VBS script that creates the output you want on their end?

    • #2384872

      That’s a fairly specific requirement so you may as well do it yourself – I would.

      cheers, Paul

    Viewing 2 reply threads
    Reply To: Parse dir output (any)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: