How to go through all the data folder in the data browser?
ytongchn
Hi,
I am treating my data from one instrument now. But I have some coding problems.
Here is what I want to do
-----
- Go check all the folder in the data browser to see if any folder has a wave with a specific length.
- If there is a wave with that specific length, I treat that wave (this step I have already written a function to do).
- If there is no wave with that specific length, I jump to the next folder or previous foder.
-----
Basically, I have to go through all the folders in the data browser and go into that folder to check the existence of that wave. I know how to scan folder on the disk with NewPath and indexeddir functions, but when I tried to do the similar things on my data browser, it failed.
Please help me with this? If you already have the code doing this sort of thing, please attach it here. If you have some good ideas on how to achieve this, please also enlighten me.
Thanks!
Maybe the following will help you recursively search the data structure of the experiment:
DisplayHelpTopic "GetIndexedObjNameDFR"
February 14, 2019 at 07:52 am - Permalink
Here's a function I wrote to graph waves called "ThingName" from a set of folders. You should be able to use it as a template for what you're trying to do.
String ThingName
Variable skipfolders, nfolders //Use nfolders=-1 to plot all
String StartDF=GetDataFolder(1)
Variable j=0
Display
If(nfolders==-1)
nfolders=CountObjects(StartDF, 4)
EndIf
For(j=skipfolders;j<nfolders;j+=1)
String FolderName=GetIndexedObjName(StartDF, 4, j)
SetDataFolder FolderName
Wave Thing=$(ThingName)
AppendToGraph Thing
SetDataFolder StartDF
EndFor
End //PlotAllOfSomething
May 21, 2019 at 11:38 am - Permalink
There is an example of recursively examining data folders in the Igor reference help for the WaveRefIndexedDFR function. The example is called DemoWaveRefIndexedDFR.
May 21, 2019 at 02:57 pm - Permalink