Results 1 to 5 of 5
  1. #1

    File names to txt

    I've got a list of ten Word documents (files) on my floppy disk. I'd like to cut and paste the ten document/file names into text form so that I can put it in a Word document. I don't want to do a print screen of the documents, but just find a way to copy the file names in text form. Does that make sense? Thanks for your help.

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    New York, NY
    Thanked 29 Times in 27 Posts

    Re: File names to txt

    Your post is a little unclear but I'm assuming you've got ten files on a floppy disk, and when you mention a list you're referring to the view you have in Windows Explorer, of the contents of the floppy disk?

    If you don't mind manually cutting and pasting, you can get the name of each file in copyable form by right-clicking on each file name, then clicking on Rename on the popup menu. The file name will become editable text, but more importantly the filename will be selected, so all you need to do is just Copy, and then click elsewhere in the window so the filename de-selects. You can then paste this text into a document. You'd then need to repeat this for each file.

    You can also get a macro to do the whole process for you.

  3. #3
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Thanked 0 Times in 0 Posts

    Re: File names to txt

    Try this macro:
    <pre>Sub List()
    DocPath = "a:" ' Set the path.
    DocName = Dir(DocPath, vbDirectory) ' Retrieve the first entry.
    Do While DocName <> "" ' Start the loop.
    PrintName = DocName + Chr$(13) 'Add carriage return
    Selection.TypeText Text:=PrintName
    DocName = Dir ' Get next entry.
    End Sub</pre>

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    West Long Branch, New Jersey, USA
    Thanked 9 Times in 7 Posts

    Re: File names to txt


    I think Leif's macro is better than the following. But another approach might be useful.

    There have been threads (not sure if it was on the General Office Solutions lounge; I'd bet it was on the Windows lounge) that ask how to capture a list of file names from Explorer.

    One such solution was about 2-3 months ago. It creates another entry on the short cut menu that pops up when you right click a folder in Explorer. By choosing this entry, you can create a file of names in the folder. The drawbacks to this particular solution were that:
    - it used the DOS DIR command to create the file; hence it had the extraneous stuff that the DIR command created (eg, the folder name)
    - since it used DOS, it only showed names in 8.3 format

    Altho the solution offered would only create one file of names(hence, if you use it a second time, the first file was overwritten), I modified it slightly to just add a second request to the end of the original output file. I sent in some comments in the thread I'm thinking of towards this end.

    The approach was described entirely on the thread and involved just a few steps to set things up.

    I believe that there have been other threads on related topics in the Windows lounge (of how to capture names from Explorer) - or it may have been part of the thread I'm referring to. I think other than the one above, all the other solutions involved buying some software (or downloading some trial versions of software).


  5. #5
    3 Star Lounger
    Join Date
    May 2001
    Burlington, KS, USA
    Thanked 0 Times in 0 Posts

    Re: File names to txt

    I'm guessing that you are creating a label for your diskette, listing the files within. If you want simple text, and are running Windows 3.1/95/NT, you can go to a DOS prompt (a/k/a Command Prompt), and type
    <pre> DIR /B A: > C:TEMPFILENAME.TXT</pre>

    presuming that A: is the drive letter for your floppy drive, and where FILENAME.TXT is the name of a text file. You can then open that text file in Word.
    The postings on this site are my own and do not necessarily represent the position or opinion of WCNOC.

Posting Permissions

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