Skip to main content

JCAMPLoadWave

JCAMPLoadWave /A[=baseName ] /D /H /I /N[=baseName ] /O /P=pathName /Q /R /V /W [ fileNameStr ]

The JCAMPLoadWave operation loads data from the named JCAMP-DX file into waves.

Parameters

If fileNameStr is omitted or is "", or if the /I flag is used, JCAMPLoadWave presents an Open File dialog from which you can choose the file to load.

If you use a full or partial path for fileNameStr, see Path Separators for details on forming the path.

Flags

/AAutomatically assigns arbitrary wave names using "wave" as the base name. Skips names already in use.
/A=baseNameSame as /A but it automatically assigns wave names of the form baseName0, baseName1.
/DCreates double-precision waves. If omitted, JCAMPLoadWave creates single-precision waves.
/HReads header information from JCAMP file. If you include /W, this information is stored in the wave note. If you include /V, it is stored in header variables.
/IForces JCAMPLoadWave to display an Open File dialog even if the file is fully specified via /P and fileNameStr .
/NSame as /A except that, instead of choosing names that are not in use, it overwrites existing waves.
/N=baseNameSame as /N except that Igor automatically assigns wave names of the form baseName0, baseName1.
/OOverwrite existing waves in case of a name conflict.
/P=pathNameSpecifies the folder to look in for fileNameStr. pathName is the name of an existing symbolic path.
/QSuppresses the normal messages in the history area.
/RReads data from file and creates Igor waves.
/VSet variables from header information if /H is also present.
/WStores header information in the wave note if /R and /H are also present.

Details

The /N flag instructs Igor to automatically name new waves "wave" (or baseName if /N=baseName is used) plus a number. The number starts from zero and increments by one for each wave loaded from the file. If the resulting name conflicts with an existing wave, the existing wave is overwritten.

The /A flag is like /N except that Igor skips names already in use.

Output Variables

JCAMPLoadWave sets the standard Igor file-loader output variables:

V_flagNumber of waves loaded or -1 if an error occurs during the file load.
S_fileNameName of the file being loaded.
S_pathFile system path to the folder containing the file.
S_waveNamesSemicolon-separated list of the names of loaded waves.

S_path uses Macintosh path syntax (e.g., "hd:FolderA:FolderB:"), even on Windows. It includes a trailing colon.

When JCAMPLoadWave presents an Open File dialog and the user cancels, V_flag is set to 0 and S_fileName is set to "".

In addition, if the /V flag is used, variables are created corresponding to JCAMP-DX labels in the header. See Variables Set By JCAMPLoadWave for details.

Example

Function LoadJCAMP(pathName, fileName)
String pathName // Name of Igor symbolic path or ""
String fileName // Full path, partial path or simple file name

JCAMPLoadWave/P=$pathName fileName
if (V_Flag == 0)
Print "No waves were loaded"
return -1
endif

NVAR VJC_NPOINTS
Printf "Number of points: %d\r", VJC_NPOINTS

SVAR SJC_YUNITS
Printf "Y Units: %s\r", SJC_YUNITS

return 0
End

See Also

Loading JCAMP Files