Porting Central
Skip to main content

Porting Central

ez2other: Converts Datastream Files into Other Formats

What ez2other Is

Ez2other reads any datastream file (with styles and insets, created by EZ), or plain ASCII file, or source code, converts that input into the specified format, and outputs the result to stdout.

Some of the other formats currently supported are "ascii", "punchcard" (same as ascii but with limited line lengths), "html" (for Web documents), and "ipf" (a BookMaster/script-like tag language that gets compiled by IPFC into help files on OS/2).

Starting ez2other

To convert a file to another format, invoke the following command:

ez2other [-h] [-w] [-o dataobj] -f format [infile]

-h Displays usage help.

-w Forces exit status to be zero even if insets were discarded (warnings will still be printed).

-o dataobj Tells the convertor which dataobject to use, in case the file extension is not mapped in /usr/andrew/lib/global.ezinit. See the ez-extensions help for more info.

-f format Tells the convertor which output format to use. Possible choices are "punchcard##" (## is an optional width, default 72), "ascii", "html", and "ipf". Other formats may be supported in the future.

infile Name of the file to read as input. If omitted, stdin will be used.

Other Ways to Start ez2other

Convenience functions are provided to allow the "-f format" option to be omitted. The ez2plain (ascii), ez2punchcard, ez2ipf, and ez2html commands are available for this purpose.

Examples

ez2other -f ipf mytool.help > mytool.ipf

Reads mytool.help (a styled help file), converts the styles into IPF markup, and outputs the result to mytool.ipf.

The resulting file can then be compiled on an OS/2 machine with IPFC and viewed using VIEW.

C> IPFC -I MYTOOL.IPF

C> VIEW MYTOOL.INF

ez2other -f punchcard80 mydoc.d > mydoc

Reads mydoc.d (a file with styles and insets), converts it to plain ASCII, breaking paragraphs at whitespace to ensure each line contains 80 characters or less, and outputs the result to mydoc.

Warnings

ATK datastream files can have styles and multimedia insets that the desired output format has no provisions for retaining. These styles and insets will be discarded, and omitted from the output. In other words, this may be a LOSSY conversion in some cases.

If the exit status of the command is nonzero and positive, it represents the number of insets that were discarded. If you consider discarded inset messages to be merely "warnings" rather than "failures", use the -w switch.

Headings are used in IPF to delimit separate "windows" of data. Unlike in EZ, where the whole document reads as a continuous stream of text, IPF files (when compiled) are displayed as a table of contents, where each heading is an entry whose contents are viewed separately.

HTML doesn't provide a way to change margins arbitrarily, so most "indenting" styles will be ignored.

Right-justification and centering is ignored in ASCII output, since there is no "right margin". Punch card format, however, will honor those justification styles.

Related Topic