Copying & Pasting Sub-Files in a Folder to a Word Document

Ken

Banned
Kind Benefactor
Joined
Dec 28, 2007
Messages
11,478
Reaction score
6,198
Location
AW. A very nice place!
I have to print out the names of sub-files within a number of files on my desktop. I tried copying and pasting the names into a MS 2002 Word document without success. The 'paste special' option doesn't allow for an 'unformatted text' insertion which is how I usually insert oddly formatted text into a Word document. There are only 2 options in that box: 'HTML Document Objects' and 'Files,' neither of which do the trick. Regular Paste doesn't work either.

Is there some other way to transfer the names of these sub-files into a word document? (I've displayed the documents in a list in the file.) There are about 250 names I have to transfer so that would be a lot of typing, and about 1000 more names of documents that I probably should print out as well. (There's pertinent info in the file names that I need to have on record.) Cutting and pasting would be a great time saver. Thanks!

- Just for clarity, the file documents are accessed on my desktop by clicking a file. When opened twenty or so names of files inside the file appear. It's that list I want to copy and then paste into a Word Document.

(I tried pulling up a DOS list of the sub-files using the Run command, which works fine for a few folders, but as to the rest I get this message: Can not find the specified folder; or the directory comes up but is listed as empty?)
 

Xelebes

Delerium ex Ennui
Super Member
Registered
Joined
Aug 8, 2009
Messages
14,205
Reaction score
884
Location
Edmonton, Canada
Tried using Notepad? Notepad usually strips all the nasties out, just gives you plain ol' text. Once you have it in Notepad, transfer it to Word via copypaste.
 

Sophia

Self-Ban
Super Member
Registered
Joined
Apr 10, 2007
Messages
4,925
Reaction score
2,410
Location
U.K.
You could try this: Go into the folder you need, so that the DOS prompt reads

C:/WINDOWS/MYDOCUMENTS/WRITING>

(with your wanted location). Going into DOS and typing cd WINDOWS/MYDOCUMENTS/WRITING should get you there.

Then type:

dir > writingfilelist.txt

Here, dir lists the files and > sends that list to a file called writingfilelist.txt. You can alter the file name as you wish. You can then open that file with Notepad or Word and print it out.
 

GordonK

Super Member
Registered
Joined
Jun 22, 2008
Messages
210
Reaction score
27
Location
New Jersey, USA
- Just for clarity, the file documents are accessed on my desktop by clicking a file. When opened twenty or so names of files inside the file appear. It's that list I want to copy and then paste into a Word Document.

(I tried pulling up a DOS list of the sub-files using the Run command, which works fine for a few folders, but as to the rest I get this message: Can not find the specified folder; or the directory comes up but is listed as empty?
)

I don't quite understand what did you mean by opening twenty or so names ... and did you mean you have multiple sub-folders for your files?

BUT anyway, use ElaraSophia's method. Since you know how to pull up a dos command window, navigate to the top most folder of your sub-files and execute that command.

If you have sub-folders, add a "/s" switch to force the operation to include all sub-folders from that point. The command will read like this: dir /s > writingfilename.txt
 

Ken

Banned
Kind Benefactor
Joined
Dec 28, 2007
Messages
11,478
Reaction score
6,198
Location
AW. A very nice place!
... thanks everyone!
I've tried a direct copy and paste to NotePad, as Xelebes suggested. No go. Clipboard is empty when I open NotePad. Elara's tactic worked fine! but for some reason some subfolders aren't listing. I still get a statement saying specified file not found with the listfile.txt. But it's a neat thing to know. Will try adding an "/s" as you suggest Gordon and report back. Yep I do mean that I have multiple sub-folders for my files. (Not up on the terminology.) The Files are like this on my desktop:

Desktop > Writing Files > Categories > Names of Writing Files/Documents (250+)
So I've been able to get some categories to list in DOS, but more than half do not.

ps Is there any way to go back in DOS? So that if I have this on the screen:

C:\Documents and Settings\User>dir desktop/writing files/categories/animals>

I can back up to 'categories' again without having to close DOS and start over?

edt: Awesome Gordon!
Works. I still have 3 files out of 15 that aren't listing contents, but that's okay. I can easily type those out myself. So consider this question resolved :)
 
Last edited:

Sophia

Self-Ban
Super Member
Registered
Joined
Apr 10, 2007
Messages
4,925
Reaction score
2,410
Location
U.K.
Yes -- typing

cd ..

will take you to the folder 'above' the one you are in.
 

benbradley

It's a doggy dog world
Super Member
Registered
Joined
Dec 5, 2006
Messages
20,321
Reaction score
3,513
Location
Transcending Canines
One could consider this a failing of GUI interfaces that there's no way to get a directory listing into a file without using a command line (something rather arcane and old-fashioned, and "normal users" should never have a need to use it). I remember wanting to do this on the Mac II in Mac OS version something like 6.1.4.
 

Ken

Banned
Kind Benefactor
Joined
Dec 28, 2007
Messages
11,478
Reaction score
6,198
Location
AW. A very nice place!
One could consider this a failing of GUI interfaces that there's no way to get a directory listing into a file without using a command line (something rather arcane and old-fashioned, and "normal users" should never have a need to use it). I remember wanting to do this on the Mac II in Mac OS version something like 6.1.4.

... I'd have to agree. Being able to print out a list of files on ones comp would seem useful enough for there to be a direct way of going about it.
 

GordonK

Super Member
Registered
Joined
Jun 22, 2008
Messages
210
Reaction score
27
Location
New Jersey, USA
One could consider this a failing of GUI interfaces that there's no way to get a directory listing into a file without using a command line (something rather arcane and old-fashioned, and "normal users" should never have a need to use it). I remember wanting to do this on the Mac II in Mac OS version something like 6.1.4.

There are ways, but more troublesome than going the old-fashioned way. One can, instead of opening a dos prompt, run a file search, and print the result either to a PDF document (needs the appropriate software) or a plain text file (needs to install/setup a generic text writer/printer that's hidden somewhere in the Windows CD.)

Alternatively, if this is something you do everyday, there are some freeware/shareware programs to make life easier. I have a dir-to-html utility installed even though I'll do the dos thing unless it's a huge project. Talk about old-school.

I've never used a Mac, but I think there should be similar hidden treasures or utilities.
 

benbradley

It's a doggy dog world
Super Member
Registered
Joined
Dec 5, 2006
Messages
20,321
Reaction score
3,513
Location
Transcending Canines
There are ways, but more troublesome than going the old-fashioned way. One can, instead of opening a dos prompt, run a file search, and print the result either to a PDF document (needs the appropriate software) or a plain text file (needs to install/setup a generic text writer/printer that's hidden somewhere in the Windows CD.)
That's a crude way of doing it, sort of like what I've thought of before, patching the OS to capture the character-write-to-the-screen function, and saving to a file each character printed.
Alternatively, if this is something you do everyday, there are some freeware/shareware programs to make life easier. I have a dir-to-html utility installed even though I'll do the dos thing unless it's a huge project. Talk about old-school.

I've never used a Mac, but I think there should be similar hidden treasures or utilities.
Yeah, only because people like me wrote them out of frustration that they didn't previously exist. I remember using the Macintosh MPW, Macintosh Programmer's Workshop, it was (of all the things on the Mac!) a command-line driven development environment written by Apple.
 

Ken

Banned
Kind Benefactor
Joined
Dec 28, 2007
Messages
11,478
Reaction score
6,198
Location
AW. A very nice place!
... looks good, Matera. Thanks!
Will let you know how it works out if I install it, as I most likely will. Always takes me a few days to decide upon some course of action ;-)