Movewave Function

In the particular piece of code I have, I have waves that are chopped into 4 pieces, then each of those pieces have a standard deviation value ascossiated with each one. so for each wave inputted, 8 waves are outputted. for ex.

Wave in: Wave_1a
waves out: wave_1a_leg1, wave_1a_leg2, wave_1a_leg3, wave_1a_leg4, sdev_wave_1a_leg1,sdev_wave_1a_leg2,sdev_wave_1a_leg3,sdev_wave_1a_leg4

As you can see, my data browser quickly gets filled. the names of the waves are made with a pretty basic(?) naming procedure
          name=stringfromlist(q,filelist)
          variable Filenamelength=strlen(name)
          name = name[20,filenamelength-5]
          wave wname=$name


where the filelist is a list of all the file from a specific folder. This little snippet makes the wave name from part of the file name.

I want to extend this naming convention idea to moving these excessive number of files to separate folders named for their filename
I Thought doing something like this would work
      NewDataFolder/O  root:$name
      movewave tobemoved :$name


this does nothing....rather, it doesn't move anything, but it does correctly make the named folders

I've tried
      NewDataFolder/O  root:$name
      movewave tobemoved :$name:


with an extra colon after the movewave folder, as that's how it normally works when i use reglular text without $. This however returns an error when I try to compile it

"A non existant data folder was referenced while acessing a child data folder"

I've tried to simply use my string "name" as I used in my example earlier where the string name references the file name "Wave_1a" from my first few lines. this simply looks for a folder called "name" and not one associated with the reference of name, which would be "Wave_1a".

I hope i've described my problem accurately thank you in advance for help!
That's not how the $ operator works: movewave tobemoved :$name:
Try movewave tobemoved $":"+name+":"

HJ
You might also want to investigate how to use DFREF and SDFR to denote where specific content is stored.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
It is actually legal to use a $ operator for a single name in the data folder path. But there is a significant gotcha to it: a colon can be part of a string expression so the following colon gets eaten up by the parser. Without actually trying it, it should work better like this: movewave tobemoved :$(name):

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com