forked from ewylie25/learningpaperone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathigor_code_stuff.txt
36 lines (30 loc) · 1.07 KB
/
igor_code_stuff.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Function LoadAll(fname)
String fname
LoadWave/J/D/W/K=0 "Macintosh HD:Users:deddu:Documents:workspace:MLtests:misc:" +$fname
WAVE frags = "frags_"+$fname
WAVE counts = "counts_"+$fname
End
Function/S DoLoadMultipleFiles()
Variable refNum
String message = "Select one or more files"
String outputPaths
String fileFilters = "Data Files (*.txt,*.dat,*.csv):.txt,.dat,.csv;"
fileFilters += "All Files:.*;"
Open /D /R /MULT=1 /F=fileFilters /M=message refNum
outputPaths = S_fileName
if (strlen(outputPaths) == 0)
Print "Cancelled"
else
Variable numFilesSelected = ItemsInList(outputPaths, "\r")
Variable i
for(i=0; i<numFilesSelected; i+=1)
String path = StringFromList(i, outputPaths, "\r")
Printf "%d: %s\r", i, path
// Add commands here to load the actual waves. An example command
// is included below but you will need to modify it depending on how
// the data you are loading is organized.
//LoadWave/A/D/J/W/K=0/V={" "," $",0,0}/L={0,2,0,0,0} path
endfor
endif
return outputPaths // Will be empty if user canceled
End