tecio.cli.teconvert

tecio.cli.teconvert#

Convert between Tecplot data file formats.

The three Tecplot file formats, SZL binary (.szplt), PLT binary (.plt), and ASCII DAT (.dat), are not always interchangeable in practice. Tecplot itself stores all data internally in binary form and provides license-free command-line utilities (preplot, tec360 -convert) for converting from lower-level formats upward to SZL, but no supported path exists for the reverse without a active license. This is a practical limitation when working with visualisation tools such as ParaView that support PLT and DAT but not SZL, or when direct inspection of file contents in a text editor is required. teconvert fills this gap by supporting conversion in any direction between all three formats without requiring a Tecplot installation.

Usage:

teconvert [-h] (-szplt | -plt | -dat) [-f] [-o PATH] FILE
Positional Arguments:
FILE

Path to the input Tecplot file (.plt, .szplt, or .dat) to convert.

Options:
-szplt

Convert to Tecplot SZL binary format (.szplt). Exactly one format flag is required.

-plt

Convert to Tecplot PLT binary format (.plt). Exactly one format flag is required.

-dat

Convert to Tecplot ASCII DAT format (.dat). Exactly one format flag is required.

-o PATH, --output PATH

Explicit output file path. Defaults to the input file stem with the new extension in the same directory as the input file.

-f, --force

Overwrite the output file if it already exists. Without this flag the command exits with an error rather than silently clobbering an existing file.

Returns:

A new Tecplot file written to the output path in the requested format. Exit code is 0 on success and non-zero if the input file cannot be read, no format flag is supplied, or the output file already exists and --force is not set.

Examples

Convert SZL to ASCII DAT:

$ teconvert -dat flow.szplt

Convert PLT to SZL:

$ teconvert -szplt flow.plt

Convert to PLT with an explicit output path:

$ teconvert -plt -o /tmp/out.plt flow.dat

Overwrite an existing output file:

$ teconvert --force -dat flow.szplt

Call directly from a Python session:

import tecio.cli.teconvert.main as teconvert

teconvert(["-dat", "-o", "flow.dat", "flow.szplt"])

See also

tecio.cli.tecextract: Extract a zone/variable subset while simultaneously converting format via the output file extension.

Functions

main([argv])

Convert a Tecplot file to the requested format.