HTML automatically generated with rman
Table of Contents

Name

tsf - type a structured file

Synopsis

tsf in=file [parameter=value] ...

Description

tsf types the contents of a structured binary file (see filestruct(3NEMO) ) in a human readable form on the standard output. The type, tag, dimensions (if any) and contents of all items are listed. The contents of CharType items are printed directly; FloatType and DoubleType items are printed in floating-point notation; all other types are printed in octal for portability reasons (see octal= below). XML format can optionally be selected as well, but this is not been well exercised. A json mode has been considered.

Parameters

The following parameters are recognized in order; they may be given in any order if the keyword is also given. Use --help to confirm this man page is up to date.
in=file
Input data is read from file, which must be a structured binary file. No default.
maxprec=t|f
If true, print float and double item data with maximum precision. [Default: f].
maxline=lines
Limits the number of lines of data typed for each item to lines. See allline= below. [Default: 4].
allline=t|f
Print all lines, it overrides any value of maxline. If xml format selected, allline will always be set to t. [Default: f].
indent=set-indent
Amount to indent contents of item-sets. [Default: 2].
margin=right-margin
Righthand margin for output. Set this to a high value to prevent possible string problems if file needs to be read by rsf. [Default: 72].
item=item-name
select only this item for output. Default: all items selected.
xml=t|f
Output in xml mode? If not, old-style human readable tsf mode is selected. [Default: f].
octal=t|f
Output of (short/long) integers in octal? Old versions used to exchange integer information in octal, we have now switched by default to decimal (more human readable). By using octal=t you can force this program back in the old mode. If take output of tsf to be read into rsf, you now need to force octal=t. [Default: f].

See Also

ls(1v) , file(1) , rsf(1NEMO) , csf(1NEMO) , qsf(1NEMO) , bsf(1NEMO) , filestruct(3NEMO) .

Debug

debug=2 reports values of MaxSetLen as defined in "filestruct.h". For MaxTagLen and MaxVecDim see rsf(1NEMO) .

Examples

An example of converting all double precision numbers to single precision in a NEMO file:

    % tsf in=double.dat out=float.dat convert=d2f
And here is an N-body snapshot of a Plummer sphere with 10 particles:
    mkplummer - 10 | tsf -
char Headline[35] "init_xrandom: seed used 1582131517"
char History[27] "mkplummer - 10 VERSION=3.0"
set SnapShot
  set Parameters
    int Nobj 10 
    double Time 0.00000 
  tes
  set Particles
    int CoordSystem 66306 
    double Mass[10] 0.100000 0.100000 0.100000 0.100000 0.100000 
      0.100000 0.100000 0.100000 0.100000 0.100000 
    double PhaseSpace[10][2][3] 0.394003 -1.98053 -0.836643 -0.466656 
      0.0439966 0.367178 -0.0762312 -0.0201540 0.0852010 0.238130 
      0.344608 0.379148 0.173722 0.311941 0.0433718 0.405117 0.747783 
      -0.555947 -0.778804 -0.580657 0.537069 -0.101942 0.0555890 
      . . .
  tes
tes

Tldr

list brief contents of a binary structured file

% tsf {{path/to/file}}

list more

% tsf {{path/to/file}}

- Show contents of a binary structured

file in brief format

tsf {{file}}

- Show contents of a binary structured file, showing all lines, and in full precision

tsf {{file}} True allline=t

Bugs

The algorithm for implementing maxline is crude.

If indent= and margin= are choosen too large, resp. too small, they can bump into each other and cause illegable output, which cannot be read by rsf either.

Author

Joshua E. Barnes.

History


xx-xxx-86    V1.0 original version    JEB
xx-apr-88    V2.0 new filestruct package    JEB
9-dec-90    V2.3 helpvec and other minor things    PJT
21-mar-01    V2.7 experimental xml output option    PJT
14-jun-02    V3.0 added octal=, but default output of integers is now decimal    PJT
21-jun-21    experimenting with a TLDR section    PJT


Table of Contents