Importer
Author : Ian Taylor
Output Types : VectorType
Date : 12 July 2000

The Importer is a unit that allows the user to input data from a text or a binary file and output the data in
Triana's Raw Data format. For binary files, the size of each data element needs to be specified by using the
Data Type choice widget (see above) and for text files each element must appear on a separate line within the
file. This may well be extended to deal with files with items separated by spaces in the next release. Also, see the
exporter unit.
The Importer Unit Window
This section appears at the upper left hand-side of the window. It controls the editing of 4 types of information
:-
- File Type :
This can be either binary or text to load in data from a binary file or a text file,
respectively.
- Data Type :
This represents the data format only if the file type is binary. It asks the user for the format of the
data stored within the binary file e.g. double, float, int, long etc. For text files, this is not needed
- Samples :
This is the number of samples you want to load in on one iteration.
- Offset :
The offset from the point of the file where you want the Importer to start reading from. This should be
specified in the number of samples not in bytes.
- Apply Offset At Each Iteration ? :
If this is set to true then the Importer skips offset samples every time the Importer is run (i.e.
each time the start button is pressed in SingleStep mode or for each iteration in Step. Cont or Continuous modes).
If this is turned off then the offset is only applied when the Importer is at the start of the file.
- Skip :
The number of samples to skip between each read. This parameter along with the offset parameter is useful for
reading columns of data from a file. For example, if you had a file containing 4 columns e.g.
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
then to pick out the 1st column specify the offset to be 0 and the skip factor to be 3 i.e.
read value1 and skip 2, 3 and 4 then read 5 etc. To read the 3rd column choose an offset of
2 and a skip factor of 3. Note that the data in the file does not have to be arranged in row and column
format. Triana reads in the next available value from the file whether they are organized evenly or not. Data can be
extracted out of any file therefore in this way.
- Swap the Bits ?
switch this flag if you are on the data has been generated on a Big endian machine and your are loading it into
a machine which is not (or vice-verse). This only applies for binary data and means, for example, that you can load
binary data files created on a Windows machine on a Unix machine.
- File Loading :
- This section appears at the bottom of the window. It consists of two rows of widgets. The first row allows the
user to choose the desired input file by typing in its name (full path and name of file) into a text field. The
buttons in the next to last row rewind the file (rewind) and allow the user to browse for the desired file
(browse). The last button makes the window invisible (i.e. the ok button).