Page 1 of 1

how to concatenate all open files into one new document?

Posted: Wed Sep 01, 2004 3:36 pm
by Lawrence
I've tried writing a macro to copy text from one document to another but macros do not seem to work across documents. I'm looking for a way to concatenate all open documents into one new document.

thanks

Re: how to concatenate all open files into one new document?

Posted: Thu Sep 02, 2004 6:02 pm
by boldan
Lawrence wrote:I'm looking for a way to concatenate all open documents into one new document.

thanks
I realize that this won't do it in Textpad, but you can concatenate several files just by using the COPY command in a DOS window. It even accepts wildcards.

Copies one or more files to another location.

COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination
[/A | /B]] [/V] [/N]

source Specifies the file or files to be copied.
/A Indicates an ASCII text file.
/B Indicates a binary file.
destination Specifies the directory and/or filename for the new file(s).
/V Verifies that new files are written correctly.
/N Uses short filename, if available, when copying a file with a
non-8dot3 name.
/Z Copies networked files in restartable mode.

To append files, specify a single file for destination, but multiple files
for source (using wildcards or file1+file2+file3 format).

Posted: Thu Sep 02, 2004 6:07 pm
by Lawrence
Indeed I have always resorted to doing it that way or with a small VB application that accepts dropped files. Too bad macros can't operate on more than one window.

thanks

Posted: Fri Sep 03, 2004 9:47 am
by helios
If the files are not open in TextPad, you can use the Insert Files option on the Edit menu to insert selected files into a new document.

Posted: Fri Sep 03, 2004 11:57 am
by Lawrence
That works great! It will certainly work for me.

thanks

Posted: Thu Mar 18, 2010 3:28 pm
by pjdusza
Is there a limit on the number of files for which this method will work?