Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

34 Automating Mif2Go conversions > 34.8 Renaming output files for automated systems > 34.8.5 Including identifiers and sequence numbers in file names


34.8.5 Including identifiers and sequence numbers in file names

To ensure uniqueness of file names for split files, when you are constructing file names based on paragraph formats you might want to include in the file-name prefix or suffix any or all of the following predefined macro variables:

<$$_fileid>

FileID (as specified in mif2go.ini) of the FrameMaker file from which the file was split

<$$_splitid>

Base name of the split file, excluding the FileID portion

<$$_splitnum>

A sequential number whose starting value and increment you can specify

To specify a starting value (default 0) and increment (default 1) for <$$_splitnum>:

[HtmlOptions]

SplitNumStart=0

SplitNumIncrement=1

The value of <$$_splitnum>:

begins at SplitNumStart for the first split file

increments by SplitNumIncrement for each subsequent split file

starts over again at SplitNumStart for each FrameMaker file.

You can format <$$_splitnum> to include leading zeroes, and to specify the number of digits; see §28.6.3 Displaying expression results in output. For example:

[StyleFilePrefix]

Head*=<$$_fileid><$$_splitnum as %0.3d>

You could use predefined macro variable <$$_basefile> instead of (or in addition to) <$$_fileid>, to supply in a prefix or suffix the base name of the FrameMaker file from which each HTML file was split:

[StyleFilePrefix]

Head*=<$$_fileid><$$_basefile><$$_splitnum as %0.3d>

You can include the base file name that Mif2Go assigns to the split file. For example:

[HTMLParaStyles]

Head*=Split Title FileName

[StyleFilePrefix]

Head*=<$$_basefile>_<$$_splitnum as %0.4d>_

[StyleFileSuffix]

Head*=_<$$_fileid><$$_splitid>

Sequence numbers have their drawbacks

There are good reasons not to use sequence numbers in file names. With sequence numbers, almost any revision can result in changes to file names. If you insert a new topic, every topic that follows gets a new file name. The default Mif2Go file naming method ensures the exact opposite: that hardly any revisions result in a file name change; the most you usually get is a name addition for an added topic. Mif2Go does not change the file names for all the following topics when you insert a new topic. Why is this important? Because any links from other documents and projects, possibly created by other writers, will be broken unless you rebuild absolutely everything in the document system, which could be thousands of files. With the default method, nothing will break. If you think you are the only one who cares about those links, do you know that will always be the case?

 



34 Automating Mif2Go conversions > 34.8 Renaming output files for automated systems > 34.8.5 Including identifiers and sequence numbers in file names