%file macros.jim {@define jamal=jamal} {#define START/TITLE= TITLE

TITLE


} {#define END=

} {#define SmallFont=} {#define EndSmallFont=} {#define TOC=TOC} {#define pre=

}
{#define ppre=
} {#define tt/X=X} {#define product=SOURCE SPLIT v1.0} {@define file=%file} %file index.html.jam {product} %file indexf.html.jam {START/{product}} This program is a simple one. It splits a text file into small pieces. The source file is like: {pre} {file} first.txt these are the lines of first.txt {file} second.txt these are the lines of the second file {file} third.txt the third file {ppre} and the results are three files each containing the lines between the directive {tt %file} and next one.

You start the program using the command line: {pre} ssplit file [directory] {ppre} to split the {tt file} into the {tt directory}. The default directory is the current one. You can change the directory using the directive {tt %dir} in the source file. The directory given on the command line, the directory given on the directive {tt %dir} and the actual file name are appended to calculate the result file. Directories are automatically created.

When a file has the same content as it had before it is not saved over the old one. This means that tools, like {tt make} can depend on file time.

Why do anyone need this tool? You may not. It is a matter of taste how big files you like to edit and maintain. Sometimes I have to edit many small files. Those times it is better to have a larger one.

Program source Perl program, this is a text file. You may need CRLF conversion if I uploaded the wrong way or if you are on a different opsys.

Documentation source in a single file. (Do not just click on it! Push the right eye of your mouse, {tt Save target as} and use notepad, vi, more as you like.) Be aware that the documentation is made using {jamal} under Windows NT. This means that this example source file will contain not only pure HTML but also weird macros. You may also be interested to have a look at the Windows NT command file that starts the scripts to generate the final HTML that you read. Note that the script locations reflect those I have on my web development system. Also be aware that this weird script first splits the source file, then applies {jamal} to generate another command file that processes all files with extension {tt .jam} that were generated. May be woth looking at how it works.

using with {jamal}

If oyu are a {jamal} user see my notes.

Bugs

There are no bugs in it that I know of otherwise I would have corrected it.

You might consider it a bug:

Feedback

As usual by eMail {END} %file lm.html.jam %file jamal.html.jam {START/Using ssplit with jamal} There are three ways using {product} together with {jamal}:
  1. Apply {jamal} to the source then split.
  2. Split the source, then apply {jamal} to the fractions.
  3. Apply {jamal} to the source then split and apply {jamal} to the fractions.
When choosing a method consider the followings: You may also write a j-SEX module that generate several files. {END} %file build.txt {#define jamal=perl ../jamal/jamal.pl} {@dir/./-f *.jam/ {#if|{#>= {#-t {$file$name}} {#-t ../{$file$nam}}}|\ {jamal} -m temp/macros.jim temp/{$file$name} {$file$nam}|} }