AsciiImport File Format Rules
See the example file, and copy that format.
These instructions provide further details if all else fails...
The trajectory and analog data may appear in separate files, or the same
file - whichever you prefer.
There is a second example "warnings" file
which will be "succesfully" read by the PlugIn, though it will generate a lot
of warnings. It illustrates the format which is allowed - though not
recommended !
Section Headings
Sections are headed by a name in upper case :-
SECTIONNAME
AsciiImport recognises sections headed TRAJECTORIES and ANALOG. Other
sections may exist in the file, and will be ignored.
- The section heading may be anywhere on the line. Any text before or
after the heading on the same line is ignored.
- Sections may appear in any order in the file.
- Sections other than those recognised by AsciiImport may appear. They
will be ignored.
Frequency Line
The next line after the heading line contains the frequency of the data in
Hz. This data is not used by ASCII Import, and is ignored, though this line
must exist in both the TRAJECTORY and the ANALOG section (even if it's blank)
Labels line
The second line in the Trajectories/analog section must contain the labels of
your data.
- Spaces are not allowed in these labels.
- Spaces or tabs must separate each label.
Trajectory Labels
If the label matches an existing trajectory, the data in the trajectory will
be overwritten. If not, a new trajectory will be constructed and added to the
trial.
The trajectory labels may optionally have a trajectory "type" appended to
the label, inside round brackets "(" and ")". Again, this should be added at
least to the X component label - the others are ignored in fact.
Spaces must not be included.
The "type" should be one of the following :-
POINT
ANGLE
FORCE
MOMENT
POWER
SCALAR
The case of the letters is not important.
Other type strings will be ignored, and the type will be assumed to be
POINT.
X Y Z line
The line following the trajectories is also ignored by ASCII Import, though
the line must be there (even if it's blank). This is to provide ASCIIDump
compatability.
Analog Labels
For analog channels, The labels line must begin with two separate words -
normally "Sample" and "#". This is to ensure compatability with ASCIIDump. In
fact ASCII Import ignores these two words, but there must be two words
present (e.g. "A" and "B" would be okay).
- There must follow a label for each channel.
- The labels must not contain spaces.
- Analog labels must not contain a "type" part in brackets.
The labels must match those found in the workstation trial (Workstation does
not allow the generation of new analog channels).
If a label is found which is not present in the trial, it, and subsequent
labels (and corresponding data values) will be ignored.
Data Values
Data follow the labels line for each section.
- Frame numbers may appear in any order. Lines are read from top to
bottom. Each new line overwrites existing data in the trial. Workstation
may extend the trial to cope with frame numbers beond the previous frame
limits of the trial, but the trial will not be shortened to the maximum
and minimum frame numbers found in your text file. It's quite easy to
save a specified range of frames from Workstation, if that's what you
want.
- Each line of numbers corresponds to a single frame or sample
number.
- The first number on the line is the frame or sample number. This must
be a positive integer. It may also be zero in the case of the analog
data.
- The following numbers on the line can be any decimal numerical
format.
- The data values must follow the order of the headings on the labels
line.
- There must be three numbers for each trajectory label, in the order X,
Y, Z.
- The program will try to read enough numbers from each line to
correspond to each of the headings that it succesfully read. Further
entries on the line will be ignored.
- If the program fails to read a number for a trajectory point component
(e.g. there's a word instead) it will insert an invalid point for that
frame.
- If the program fails to read an analog data value, it's ignored, and
the rest of the line is ignored.
The data section must be finished with a blank line (or the end of the file).
Comments
In general, the file reading code will try to interpret any comments, but it
will ignore them and continue reading the next line if it can't interpret the
text.
You can always put comments after the section heading, though you must leave
a space between the section heading and your comment.
You can also put comments at the end of each data line, so long as there are
enough numbers for the number of trajectories or analog channels succesfully
read from the labels line.
Putting alphabetic text in the middle of a line of analog data will cause the
rest of the line to be ignored.