DIMaSP
Direct Infusion Mass Spectrometry Processing

Step 4: Shoulder ion removal (runner)
Release Version 1.0

Copyright © 2017 Arthur T Zielinski

This file is part of “Direct Infusion Mass Spectrometry Processing (DIMaSP)”.
Direct Infusion Mass Spectrometry Processing (DIMaSP) is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 
Direct Infusion Mass Spectrometry Processing (DIMaSP) is distributed in the hope that it 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.
You should have received a copy of the GNU General Public License along with Direct Infusion Mass Spectrometry Processing (DIMaSP).  If not, see <http://www.gnu.org/licenses/>.

The code will run the main notebook for as many times as there are .csv files in the given directory. It assumes that the paired main notebook is in the same directory. Ensure there are no additional .csv files in the directory or the code will fail.

To run the code go to Evaluation > Evaluate Notebook. Code will be completed once “Running...” no longer appears at the top of the window. While the code is running it will display the entry in tablename it is processing. Upon completion it will display the time taken to process all of the files in tablename.

Example Input:
	directory = “C:\\Users\\Name\\Shoulder”;
	main = “S4_Shoulder_Main.nb”;

directory="C:\\Users\\Name\\Shoulder"; (* Location of main notebook *)
main="S4_Shoulder_Main.nb"; (* Name of main notebook (modified slightly) *)

SetDirectory[directory];
Do[
NotebookEvaluate[directory<>"\\"<>main];
,{nf,Length[Select[FileNames["*csv*"],StringTake[#,{-3,-1}]=="csv"&]]}];