#pragma rtGlobals=1 // Use modern global access method. //Loads into current data folder all waves with a given name pattern from all packed Igor experiments with a given name pattern from all data folders with a given name pattern //Names loaded waves filename_foldername_wavename //Copyright (C) 2004-5 Jeremy Bergsman //jeremy@bergsman.org // //These programs are free software; you can redistribute them and/or modify //them under the terms of the GNU General Public License as published by //the Free Software Foundation; either version 2 of the License, or any later version. // //These programs are distributed in the hope that they will be useful, //but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //GNU General Public License for more details: //http://www.gnu.org/licenses/gpl.html //or write to the Free Software Foundation, Inc. //59 Temple Place, Suite 330 //Boston, MA 02111-1307 //USA Menu "Data" "LoadBinaryByPatterns" End Function LoadBinaryByPatterns() String LBBPDiskFolderName, LBBPFileName="*", LBBPDataFolderName="", LBBPWaveName="GoodAvg*" String FileList, ThisFile, ErrMsg, LBBPDFSave = GetDataFolder(1) Variable FileLoop, Temp NewPath/O/Q/M="Please find disk folder" LBBPDiskFolder if (V_flag!=0) DoAlert 0, "Disk folder error" Return -1 endif PathInfo /S LBBPDiskFolder LBBPDiskFolderName=S_path Prompt LBBPFileName, "Generic File Name" Prompt LBBPDataFolderName, "Generic Data Folder Name (blank for root:)" Prompt LBBPWaveName, "Generic Wave Name" DoPrompt "Load Igor Binary Files by Patterns", LBBPFileName, LBBPDataFolderName, LBBPWaveName FileList=IndexedFile(LBBPDiskFolder,-1,".pxp") for (FileLoop=0; FileLoop=0) ThisDataFolder=ThisDataFolder[temp1,strlen(ThisDataFolder)-2] //remove "...LBBPTempDataFolder:" and final colon endif if (cmpstr(ThisDataFolder,"")!=0) //If there's a data folder (not root) then add it with another underscore WNPrefix+=ThisDataFolder+"_" endif for (WaveLoop=0; WaveLoop