User Tools

Site Tools


visual3d:documentation:pipeline:file_commands:import_data_from_ascii_file

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
visual3d:documentation:pipeline:file_commands:import_data_from_ascii_file [2024/06/19 13:37] – removed sgrangervisual3d:documentation:pipeline:file_commands:import_data_from_ascii_file [2024/07/17 15:45] (current) – created sgranger
Line 1: Line 1:
 +====== Import Data From ASCII File ======
 +
 +The command below will Import signals from an ASCII file formatted using the [[Visual3D:Documentation:Definitions:File_Formats:Visual3D_ASCII_Format|Visual3D_ASCII_Format]].
 +
 +<code>
 +Import_Data_From_Ascii_File 
 +/FILE_NAME= c:\exampleData\Test Command Input Signals\testInputData.txt 
 +;
 +</code>
 +
 +==== 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.
 +
 +<code>
 +!============================================================================
 +! 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
 +;
 +</code>
 +
 +\\
 +\\
 +[[Visual3D:Documentation:Pipeline:General_Information:Pipeline_Commands_Reference|Back to Pipeline Commands Reference]]
 +
 +
  
visual3d/documentation/pipeline/file_commands/import_data_from_ascii_file.1718804234.txt.gz · Last modified: 2024/06/19 13:37 by sgranger