Results 1 to 11 of 11
  1. #1
    Star Lounger
    Join Date
    May 2002
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Save Directory to Text File

    Is there a way to save the file list in a directory/folder to a text file, either in WinXP Pro or Win 98 SE? I want to create a database file listing the contents of various directories, and have been doing it by printing the directory listing (using a program written by one of our IT people at work; he doesn't have time to come up with a program to save as text), then scanning/OCRing the list. I'd like to be able to save directly from, say, Windows Explorer, to a text file, which could then be imported into Access.

    Thanks for your assistance,
    Terry

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Save Directory to Text File

    The free utility Karen's Directory Printer is very popular among Loungers. Export to a tab-delimited text file is one of its features.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Save Directory to Text File

    Another old standby is to drop to a command window and use the DIR command. To get just file names,

    dir /b > filelist.txt

    To see all your sorting and other options, use dir /?

    But, of course, the format is not as nice as CSV if you're importing into a database.

  4. #4
    Star Lounger
    Join Date
    May 2002
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save Directory to Text File

    Thanks for the suggestions. I've downloaded Karen's Directory Printer, and will give it a try. I may not be able to install it at work (the IT people guard their turf vigorously), but can always copy the files to CD and create my database at home. There are strict rules about bringing files from home, but even the IT people do it. Since "they" won't provide us with the software we need to do our jobs efficiently at work , doing it at home is the only option (I have no OCR program at work, either, so have had to do this project the hard way on my own time as well).

    And that's why government doesn't work. Too much turf guarding, and not enough concern for the needs of the end-users. End of rant.

    Terry

  5. #5
    Uranium Lounger
    Join Date
    Mar 2001
    Location
    New Jersey
    Posts
    6,684
    Thanks
    1
    Thanked 11 Times in 11 Posts

    Re: Save Directory to Text File

    Another little utility you might want to try for this task is Treeprint from PC Magazine. It says it's written for Win 9X and Windows NT, but I'm running it on XP Pro SP1 now with no troubles at all. I've used Karen's program as well. I just happen to prefer this one. Different strokes...... as the saying goes. Just thought you'd like to have the choice.
    <IMG SRC=http://www.wopr.com/w3tuserpics/DocWatson_sig.gif>

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Save Directory to Text File

    This probably explains why Office VBA solutions are so popular: what harm could there be in letting users write a few macros?

    If all else fails, you can use VBScript's FileSystemObject, hosted in any Office application (e.g., Word, Excel, Access) to read in the directory contents. It would take longer to develop, but it would be more direct than a multiple-step process that involves burning a CD!

    [Hours later...]

    Here's an example in Excel. If any Excel gurus want to fix the "AutoFit" part, it would make for a nicer product.

  7. #7
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Save Directory to Text File

    Very nice.

    To fix the autofit you can replace all your commented out stuff with
    <font face="Georgia">sht.Columns.Autofit</font face=georgia>

    StuartR

  8. #8
    Star Lounger
    Join Date
    May 2002
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save Directory to Text File

    I want to thank everyone for their suggestions. The Excel macro that J. Scher wrote seems the way to go, because I can use it at work without violating any IT rules. Additionally, although the final destination of my file list is Access, I'm assembling it in Excel, since I can add accessory information more easily in Excel.

    Thanks for the time and effort you put into this, Jefferson.

    Terry

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Save Directory to Text File

    Thanks, Terry. I only do about one Excel macro a year, so it's always a bit of an ordeal, but it did seem to be the ideal container as a way station to Access.

  10. #10
    New Lounger
    Join Date
    May 2004
    Location
    Delaware, USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save Directory to Text File

    I just have to let you know how incredibly helpful this code was. THANKS, you are awesome! <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

  11. #11
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Save Directory to Text File

    Thanks! The funny thing is, I have absolutely no memory of this thread. Thank goodness for search. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •