Accessing Loaded waves within a procedure
Fri, 02/17/2017 - 01:01 pm
I've been working on some code that isn't too complicated and I've found a few posts about what i'm trying to do, but pretty much, I want to access various folders and load the delimited text files from within the folders, entire folders at a time. Here are the hangups that make it different:
-Each pice of data has 2 sets of delimeted text files associated with it. They are in the folder like this:
and it is easy enough to put the loop in my code to iterate by 2 each step to pull onnly every other set. However, in the files, I only want the second column of data which I have achived with the /L flag in loadwaves.
Herein lies the first issue. I really would like an option not to load the same waves if i add more files from the same folder, But as is, I keep getting duplicate waves if i use the same procedure multiple times on the same source folder. I've tried an if statement that compares the content of the waves using waveexists() funtion, but since I am only using the second column, i think it's sneaking by this if statement. This is the first issue that I am trying to resolve.
The second lies with the naming of the waves. because of the loadwave function, The waves go straight from my folder to the :root: folder , and are named wave# incremented by 1 according to the /a flag. I would like the ability to append the waves to a table as I load them into igor. but since I don't know the # that is getting assigned to them as they are loading into igor, I have been unable to do this. Also, since data is loaded in more than once, Assigning the waves a #= loop# won't work since it would get overwritten. Is there a way to extrapolate the name of the actual wave that is being automatically assigned as it gets loaded into igor, and store it as a string or as an actual wave in the program?
Thirdly, more simply, is there a way to sort waves by number of points?
lastly, here is my code attached as image. And if you choose, to help, please try to not be too complicated, I'd really liek to understand how things work so i can move on from here.