Guide to Madagascar programs |
string | form= | ascii, native, xdr | |
---|---|---|---|
string | format= | Element format (for conversion to ASCII) | |
bool | ibm=n | [y/n] | Special case - assume integers actually represent IBM floats |
int | line=8 | Number of numbers per line (for conversion to ASCII) | |
bool | trunc=n | [y/n] | Truncate or round to nearest when converting from float to int/short |
string | type= | int, float, complex, short |
The sfdd program is used to change either the form (ascii, xdr, native) or the type (complex, float, int, char) of the input dataset.
In the example below, we create a plain text (ASCII) file with numbers and then use sfdd to generate an RSF file in xdr form with complex numbers.
bash$ cat test.txt 1 2 3 4 5 6 bash$ echo n1=6 data_format=ascii_int in=test.txt > test.rsf bash$ sfin test.rsf test.rsf: in="test.txt" esize=0 type=int form=ascii n1=6 d1=? o1=? 6 elements bash$ sfdd < test.rsf form=xdr type=complex > test2.rsf bash$ sfin test2.rsf test2.rsf: in="/tmp/test2.rsf@" esize=8 type=complex form=xdr n1=3 d1=? o1=? 3 elements 24 bytes bash$ sfdisfil < test2.rsf 0: 1, 2i 3, 4i 5, 6i
To learn more about the RSF data format, consult the guide to RSF format.
Guide to Madagascar programs |