String swapping is an essential aspect of creating a well functioning pipeline. It works by writing the scripts filled with strings in [ ] brackets rather than values. The script will not be able to run on its own, but when using it in conjunction with the configuration file and the batch context plugin you can rapidly create unique .m scripts for each of your dataset files. You can also adjust the the script functions without permanently changing the code.
Below we have a .htb pipeline script that is looking for 5 swap string inputs 4 from the config file, and 1 from the dataset file name. The configuration swap string section should look like this:
```
[in_path],analysis/data/1_init
[low_bound],.1
[high_bound],30
[out_path],analysis/data/2_preproc
```
The swap string [batch_dfn] is special as it automatically takes its information from the loaded dataset files.
***
Please refer to Configuration]() for more information on how change your swap string values.
Continue to learn about how to place the [strings] in your scripts.
**Before string swap:** The string [low_bound] is waiting to be replaced with a number.
```matlab
%%FILTER HIGH PASS...
disp('High pass filtering the data...');
...
...
@@ -50,17 +82,38 @@ EEG = eeg_checkset( EEG );
disp('TIME TO: FILTER HIGH PASS...');
toc
```
**After string swap:** You can see that the previous [low_bound] has been replaced with a number .
```matlab
% remove comps manually
disp('REMOVE MARKS AND COMPS');
% remove marks
%%FILTER HIGH PASS...
disp('High pass filtering the data...');
tic;
EEG.setname='filtHP';
EEG=eeg_checkset(EEG);
disp('TIME TO: FILTER HIGH PASS...');
toc
```
%WAIT FOR SCROLL PLOT TO CLOSE...
uiwait;
## Building in Manual Steps
Running a pipeline with manual steps is also possible. In the example below the batch will automatically open the file and do a plot. It will then wait for the user to type in the *ms* time they would like to investigate. It then proceeds to open that time frame for inspection. Once the first plot is closed, the next .m file will run loading the next dataset.