2.16.3.31 Details of TreeNodes in Import WAV


Options

The Options tree specifies all import options for the impNITDM X-Function.

Syntax: Options.Treenode:=<value>

Example: Options.sparklines:=0 // Do not add sparklines



Treenode Label Type Default Description
FirstMode 1st File Import Mode int 0 Specify the import mode for the 1st file.Options include:
  • Replace Existing Data
    The data that exists in the target window will be wiped out. And the new data will be imported into it.
  • Start New Books
    Create a new book for the file that will be imported.
  • Start New Sheets
    Create a new sheet for the file that will be imported.
  • Start New Columns
    Add new columns to the target worksheet and import the data into the new columns.
Mode Multi-File (except 1st) File Import Mode int 4 Specify the import mode from the list for the files other than 1st. Options include:
  • 3:Start New Books
    Create a new book for the file that will be imported.
  • 4:Start New Sheets
    Create a new sheet for the file that will be imported.
  • 1:Start New Columns
    Add new columns to the target worksheet and import the data into the new columns.
Template Template Name String This option is available when the Import Mode is Start New Sheets or Start New Books. Specify the template to import the file to a new book or new sheet. A special template <clone> can be used to specify current workbook or matrix book as template to import files.
sparklines Add Sparklines int 2 Specify whether to add the sparklines of the data.
  • 0: No
    Do not add sparklines
  • 1: Yes
    Add sparklines
  • 2: Yes(if less than 50 columns)
    Add sparklines if less than 50 columns
bSaveFileInfo Save File Info. in Workbook int 1 If selected, the file information will be saved to the workbook. If not selected, the file information will not be saved in Organizer and the reimport will not work, but the import speed can be improved.

Names

The Names branch of the Options tree specifies how to name the worksheet and workbook.

Syntax: Options.Names.Treenode:= <value>

Example:
//Rename worksheet with partial filename  :
Options.Names.FNameToSht:=1
Options.Names.FNameToShtFrom:=1
Options.Names.FNameToShtTo:=4


Treenode Label Type Default Description
AutoNames Auto Rename using file name int 0 If it is checked, Origin will use the default settings to rename the worksheet and workbook name, which is:
  • Use the whole filename (includes the file extension) as worksheet name.
  • Use the whole filename (includes the file extension) as workbook name if current workbook is empty or the import mode is Replace Existing Data.
FNameToSht Rename Sheet with (Partial) Filename int 1 Check this to use part of the filename as worksheet name.
FNameToShtFrom Trim Filename From int 1 Specify the start of the name.
FNameToShtTo Trim Filename To int 0 Specify the end of the name.
FNameToBk Rename Book with (Partial) Filename int 1 Check this to use part of the filename as workbook name.
FNameToBkFrom Trim Filename From int 1 Specify the start of the name.
FNameToBkTo Trim Filename To int 0 Specify the end of the name.
FNameToBkLnOnly Rename Long Name for Book only int 0 Check this to rename the long name for book only.
FPathToBk Include File Path when Renaming Book int 0 Specify if the file path should be included for the workbook name.
FNameToBkComm Append Filename to Workbook Comment int 1 Specify if the filename should be appended to the workbook comment.
FNameToColComm Append Filename to Column Comment int 1 Specify if the filename should be appended to the column comment.
FNameToUDL Add Filename User Parameters Row int 0 Specify if the file name should be put to the column User Parameter row "SourceFile".
FPathToComm Include path when appending filename int 0 When this is checked, the import file path is appended to the workbook's command and/or Comments row.
Notes:

From Origin 8.6, minus value is supported in FNameToBkFrom and FNameToBkTo to count the end of the name from the last character of the file name. It can be used to trim the file extension when you rename book. For example, if you want to import a waveform audio file named sample.wav, you can specify the setting as below to trim the extension ".wav" when renaming the workbook name:

Options.Names.FNameToBkFrom:=1
Options.Names.FNameToBkTo:=-4

partial

The partial branch of the Options tree specifies how to partially import the file.

Syntax: Options.partial.Treenode:= <value>

Example:
//Partially import the file from the 1st sample to the 30th sample
Options.partial.Partial:=1
Options.partial.FirstSample:=1
Options.partial.LastSample:=30

Treenode Label Type Default Description
Partial Partial Import int 0 Set it to 0 to disable partial import; set it to 1 or 2 to enable partial import. 1 means apply partial import settings to all files and 2 means apply partial import settings to all files except 1st file.
SkipSamples Skip Points int 0 Some points can be skipped according to your setting. This is only available when Partial is enabled(set to 1 or 2).
FirstSample Start Point int 1 You can set the start point of the file to be imported. This is only available when Partial is enabled(set to 1 or 2).
LastSample End Point int 0 You can set the end point of the file to be imported. This is only available when Partial is enabled(set to 1 or 2).