PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
![]() | ![]() | ![]() | ![]() | ![]() |
Generate Mask |
A generate mask is used to create a new filename based on the full name of the main input file being processed.
The GenerateFileName() routine uses generate masks as do the following switches (which make use of the rexx call):
The simplest generate mask is simply the name of a relative or absolute file such as "c:\output\new.htm" or "out\new.html". While the simplest form, it is rarely used, for example if this was used on the /Output switch then all input files would generate the same output file (each overwriting the previous output).
There are special predefined characters and strings which allow you to indicate parts of the source file that you wish to use to create the output filename. An example of this is "out\*.html" which says that the output file is to go into the directory named "out" and will have the same "base" name as the source file but with the extension ".html", so if you were building html for "tryme.it" then the html being generated would be placed into "out\tryme.html".
The following describes some case sensitive special strings and characters which can be embedded anywhere in a generate mask:
Note that unix type operating systems will probably have problems with "$path" etc when used on the command line (to unix this means replace with the "PATH" environment variable's contents). You need to hide or escape the dollar sign, so use either "{x24}path" or "\$path" instead.
Note that resultant relative filenames are always relative to the current directory.
While you can control the case of the mask (not controlled by the special codes), you can't control the case of what the codes replace. What you can do is ensure the whole name is either in upper or lower case with the /FileNames switch or EnsureFileHasCorrectCase() call.
Generate ".html" in OUT directory #1 |
You wish output created in the "OUT" directory (relative to current directory):
ppwizard *.it /Output:OUT\*.html
Generate ".html" in OUT directory #2 |
You wish output created in the "OUT" directory (relative to input file):
ppwizard *.it /Output:{$PATH}OUT\*.html
Separate Source and Destination Trees |
ppwizard +c:\src\*.it /output:c:\tmp\out\{$path}*.htm
The file "c:\src\1.it" would create "c:\tmp\out\1.htm" and "c:\src\subdir1\subdir2\1.it" would create "c:\tmp\out\subdir1\subdir2\1.htm".
You might also wish to check out the /BaseDir switch although it is not really required unless you wish to process a subtree of a larger tree which you normally process.