Hello world!
Here is the gist:
I have spectra that has 3 different variations. I have 64 scans (individual files) per variation. I have neatly organized them into their respective folders. My goal is to export a .csv for each variation. So far I have written the script up to add up all 64 scans and make it a nice 2-d array of data then export to a .csv. However, I want to write a For-Loop that does it for the 3 variations as well. So it goes into one directory, adds, comes back to the parent, and goes to the next directory, adds again and etc.
Problem is, I attempt to use SetDirectory and it rejects the Loop because it is not a String-value. I used the ToString command and it rejects that as well.
The actual error is
SetDirectory::fstr: File specification {BG ,data.csv,Sigma Minus ,Sigma Plus} is not a string of one or more characters
Here is the relevant code:
b = FileNames[];
For[i = 1, i <= Length[b], i++,
InputForm[StringDrop[StringDrop[ToString[Take[b, i]], -1], 1]]
SetDirectory[%]
Any and all help is greatly appreciated.