
Merging all waves in sub folders

I'm trying to figure out how to concatenate a large set of waves that are in individual folders. The files are loaded as hdf5 files and import about 300-500 waves, but the data group gets loaded with each individual wave in a separate folder. This leads to a set of 300-500 folders each with a single wave instead of all waves in a single folder. I would like to concatenate each wave in each folder, but cannot seem to find a way to select every wave in a subfolder. Alternatively, with the hdf5 loader, I would prefer to load all waves into a single folder, but there doesn't seem to be an option to do this either unless you select each of the 300-500 individual datasets and load them as a dataset instead of a group.
I think you problem calls for recursively searching all folders/subfolders from a specific starting point while extracting a list of waves, and then finally concatenating this list of waves. There is a very old thread about listing all waves, which should get you most of the way there. The concatenating part is trivial as long as you don't have to fight with different wave sizes. See here:
https://www.wavemetrics.com/forum/general/get-list-all-loaded-waves
The function from this link might be a bit overkill, since it covers all cases you'd ever want. Maybe trim this down to your specific case if necessary (i.e., only recursively listing waves).
April 22, 2025 at 07:23 pm - Permalink
That should happen only if each dataset is in a separate HDF5 group.
If you can post a sample HDF5 file, I will see if I can figure out how to do this programmatically.
April 23, 2025 at 03:09 pm - Permalink