Table of Contents


tsf - type a structured file


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


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.


The following parameters are recognized.
Input data is read from file, which must be a structured binary file. No default.
If true, print float and double item data with maximum precision. [Default: f].
Limits the number of lines of data typed for each item to lines. See allline= below. [Default: 4].
Print all lines, it overrides any value of maxline. If xml format selected, allline will always be set to t. [Default: f].
Amount to indent contents of item-sets. [Default: 2].
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].
select only this item for output. Default: all items selected.
Output in xml mode? If not, old-style human readable tsf mode is selected. [Default: 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=2 reports values of MaxSetLen as defined in "filestruct.h". For MaxTagLen and MaxVecDim see rsf(1NEMO) .


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 
  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 
      . . .


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.


Joshua E. Barnes.


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

Table of Contents