Import Data From ASCII File

From Software Product Documentation
Jump to navigation Jump to search

The command below will Import signals from an ASCII file formatted using the Visual3D_ASCII_Format.

Import_Data_From_Ascii_File 
/FILE_NAME= c:\exampleData\Test Command Input Signals\testInputData.txt 
;

Filename

It is important to note that if you want the data imported to an existing file in the workspace, the first row must contain the entire file name (including path) or Visual3D won't know which c3d file to add to.

Command

An example, the following commands will import events created in another program and convert them from time to frames via an expression command. They will be placed in the Event_Label folder.

!============================================================================
! This script will import Events in frames from ASCII into the METRIC Folder
! Events are labeled LHS1, LHS2, LHS3, RHS1, RHS2
! The ASCII Filename must be the same as the V3D ACTIVE filename 
! The events in the METRIC folder will be converted into frames and placed in
! the EVENT_LABEL folder
!=============================================================================

! Select active file
Select_Active_File 
/FILE_NAME=*mb007.smt
! /QUERY= 
;

Import_Data_From_Ascii_File
/FILE_NAME=*mb007.txt
;

! Loop to convert events from time to frames for 4 HS reps
For_Each
/ITERATION_PARAMETER_NAME=INDEX
/ITEMS=LHS1+LHS2+LHS3+RHS1+RHS2
;

! Expression to convert events wrt time
Evaluate_Expression 
/EXPRESSION=METRIC::EVENT_IMPORT&:&:&::INDEX&[1]&/PARAMETERS::POINT::RATE 
/RESULT_NAME=::INDEX
/RESULT_TYPE=EVENT_LABEL
/RESULT_FOLDER=ORIGINAL
;

End_For_Each
/ITERATION_PARAMETER_NAME=INDEX
;

! Delete EVENT_IMPORT Folder to clean up
Delete_Folder
/SIGNAL_TYPE=METRIC
/FOLDER=EVENT_IMPORT
;



Back to Pipeline Commands Reference

Retrieved from ""