Relacs
0.9.8
|
bin2dat can be used to convert binary data as they are produced by RELACS, and especially the IOData::writeBinary() functions, into ascii data files.
bin2dat
<binfile> <datfile> <options>
The first argument <binfile> is the full specification of the file containing the binary data. The second argument is the output file in which the ascii data are written. The program tries to guess the data type of the binary file from its extension. See IOData::binaryExtension() about the standrd extension. The data type as well as the range of data can be specified by several options.
-s
0 : The data are unsigned. -s
1 : The data are signed. -d
x : The size of a single data element is x bytes. Only values of 1, 2, 4, 8 are allowed. -c
x : Data from x channels are multiplexed in the file. -o
x : Write data starting from byte offset x. -O
x : Write data starting from byte offset x times the size of a single data element. -u
x : Write data up to byte offset x. -U
x : Write data up to byte offset x times the size of a single data element. -n
x : Write x bytes of data. -N
x : Write x data elements per channel. -T
x : Write x divided by the time step (-t) lines of data.-t
x : Add a time column to the ascii file with time step x. -v
: Print settings to stderr.To convert the whole binary file data.sw1
into the ascii file signal.dat
use
To convert only data elements 5 to 10 use
Data element 5 of a sw1
-file (signed word) is at byte offset 10. Data element 10 at 20. So, alternatively
can be used.
Write the first 100 bytes:
Write 50 data elements starting at data element 20:
Write data elements 14 to 43 and add a time column with time step 0.1:
Convert binary data file data.dat
, which contains signed word (two bytes long) data of three multiplexed channels into ascii-file signal.dat: