#pragma TextEncoding = "UTF-8" #pragma rtGlobals=3 // Use modern global access method and strict wave access. // Get the folder path. Menu Reactor; Load Reactor, LoadDataFromCSV() End Function LoadDataFromCSV() string folderPath string fname string wname variable i getfilefolderinfo/D newpath/O GCFolderData S_path string fileList= indexedfile(GCFolderData,-1,".csv") do //store the ith name in the list into wname. fname = stringfromlist(i,fileList) //strip away ".txt" to get the name of the chromatogram, which is the file name //!!!!!!!!!! change the next line if you want a different name for the waves that are created !!!!!!!!!!!!!!! wname = fname //reference a wave with the name of the chromatogram. wave w = $wname //if the referenced wave does not exist, create it. if (!waveexists(w) ) //The /L parameter tells IGOR to load no headers, and to load the 3rd column of data (indexed as 2) only //!!!!!!!! You must change this next line to tell IGOR how to load the data in each file !!!!!!!!!!!!!!! LoadWave/J/N=wave/P=GCFolderData/O/L={0,0,0,0,0} stringfromlist(i,filelist) LoadWave/J/N=wave/P=GCFolderData/O/L={0,0,0,1,0} stringfromlist(i,filelist) //wave created is wave0. It is renamed after the chromatogram. //And scaled accordingly. //!!!!!!!!! you MUST change or delete the following line according to your data's scaling or lack thereof. !!!!!!!!!!!! //Print confirmation of what was just loaded. print "Loaded "+fname else //Othewise, tell the user that this chromatogram was previously loaded. print fname+" was previously loaded. Its corresponding wave exists." endif i += 1 //move to next file while(i