Autoimport: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Neal
imported>Jeremy
Line 10: Line 10:
===Description===
===Description===


Automatically identifies a filetype and calls the appropriate reader. If no file name (filename) is provided, the user is prompted for a desired filetype to browse for. If no file name is provided but a specific file type is provided, the user is prompted for a file of the given type.
Automatically identifies a filetype and calls the appropriate reader. If no file name (filename) is provided, the user is prompted for a desired filetype to browse for. If no file name is provided but a specific file type is provided, the user is prompted for a file of the given type. If both a filename and a method name are provided, the given file will be loaded
  using the specified method disregarding the file extension.
Input (methodname) can be any valid importer method name (method types / file extensions) a list of which can be retrieved using the command:
    autoimport('methods')
 
Optional input (options) is described below.


If output is requested, the loaded item(s) is/are returned as a single output. If no outputs are requested, the items are loaded into the base workspace or other action as defined by the options structure.
If output is requested, the loaded item(s) is/are returned as a single output. If no outputs are requested, the items are loaded into the base workspace or other action as defined by the options structure.
Input (methodname) ...
Optional input (options) is described below.


===Options===
===Options===

Revision as of 12:56, 7 October 2008

Purpose

Automatically reads specified file. Handles standard file types.

Synopsis

autoimport(filename,methodname,options)
[data,name,source] = autoimport(filename,methodname,options)

Description

Automatically identifies a filetype and calls the appropriate reader. If no file name (filename) is provided, the user is prompted for a desired filetype to browse for. If no file name is provided but a specific file type is provided, the user is prompted for a file of the given type. If both a filename and a method name are provided, the given file will be loaded

 using the specified method disregarding the file extension.

Input (methodname) can be any valid importer method name (method types / file extensions) a list of which can be retrieved using the command:

    autoimport('methods')

Optional input (options) is described below.

If output is requested, the loaded item(s) is/are returned as a single output. If no outputs are requested, the items are loaded into the base workspace or other action as defined by the options structure.

Options

options = a structure array with the following fields:

  • target: [ {'workspace'} | 'analysis' | 'editds'] Target for file load. If 'workspace', file contents are loaded into base workspace (the default behavior). If 'analysis', file contents are automatically dropped into an empty Analysis GUI interface. If 'editds', file contents are loaded into a DataSet editor.
  • defaultmethod: [{'prompt'} | 'string' | 'error' | methodname ] governs how to handle input (filename) when no recognizable file extension can be found. 'prompt' prompts the user to identify the appropriate importer, 'string' interprets the input as a string, 'error' returns an error. Any other valid methodname can also be provided (use autoimport('methods') to get list of valid methods),
  • error: [ 'error' | {'gui'} ] governs how to handle errors during imports. 'error' returns an untrapped error, 'gui' traps the error and presents an error dialog to the user.

See Also

imageload, jcampreadr, parsexml, spcreadr, xclreadr, xyreadr