Really fast way to combine multiple files


[ Delphi Forum ] [ Delphi Tutorials -- by DelphiLand ]

Posted by webmaster Guido on August 07, 2003

In Reply to: Faster way to transfer multiple source code files to a word doc posted by webmaster Guido on August 07, 2003:

: I need to transfer all my delphi codes to a word document for my report, but i am facing difficulty doing that. what is the easiest way?

-----------

Shame on me, I almost forgot about the humble .BAT scripting language...

Here's the idea: let a batch program combine all your Delphi source code files to one big textfile:

1. In Windows Explorer, navigate to the folder that contains your project.

2. Create a new text file, and rename it to COMBINE.BAT

3. Put the following text in this file and save it:

dir *.dpr /b > filelist.txt
dir *.pas /b >> filelist.txt
FOR %%1 in (*.dpr) do type %%1 >> project.txt
FOR %%1 in (*.pas) do type %%1 >> project.txt

4. Doubleclicking COMBINE.BAT merges all .dpr and .pas files into PROJECT.TXT -- now open this one in Word and format it to your desire.


Related Articles and Replies:


 

[ Delphi Forum ] [ Delphi Tutorials -- by DelphiLand ]