loading waves with white spaces.
ukos
I'm facing problems while loading from Igor Binary files.
Within the IBW-files the wave-names are already specified (2D-Data) and are user-chosen.
The problem is that there can be white spaces within the waves from the IBW file. And this leads to incompatibility.
I load the Igor Binary File using
LoadWave strFile
while strFile is the String File Name.
afterwards I check for the first loaded wave with
strDataFolder = GetDataFolder(1)
strWave = strDataFolder + StringFromList(0, S_waveNames)
and then I duplicate the wave using
Duplicate/O $(strWave) IBW
KillWaves/Z $strWave
Now this worked fine for me, but as soon as it comes to spaces within the ibw-Wave-Names (S_waveNames) the code fails at the duplication step.
In command line I am able to add white spaces for waves like this: "root:NN NN" but in the Function above I can not use this syntax. Of Course. Because then I would get a String. ;-)
The manual says, that it should also work by directly giving the name of the wave (to avoid the name with spaces) but it doesn't...
LoadWave/N=IBW strFile
LoadWave/A=IBW strFile
Any thoughts? Are there maybe symbols like \" or sth. to use " in code.
root:folder 1:name with spaces
it must be quoted like this:
root:'folder 1':'name with spaces'
To help you with this, we provide the function PossiblyQuoteName(). So in code that computes a path like yours, you can use
String strWave = strDataFolder+PossiblyQuoteName(wname)
Wave w = $strWave
... now you can do things with w ...
You may wish to check out these help file topics:
DisplayHelpTopic "Programming with Liberal Names"
DisplayHelpTopic "Accessing Global Variables and Waves Using Liberal Names"
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
June 9, 2015 at 10:00 am - Permalink