Station 1 · Lesson 5
.set and .fdt files
eeglab_data.set (D1) · Nothing yet: the data as downloaded.Download the data (opens in a new tab)Script to reach this state
[ALLEEG, EEG, CURRENTSET, ALLCOM] = eeglab;
sampleFolder = fullfile(fileparts(which('eeglab')), 'sample_data');
EEG = pop_loadset('filename', 'eeglab_data.set', 'filepath', sampleFolder);
[ALLEEG, EEG, CURRENTSET] = pop_newset(ALLEEG, EEG, 0, 'setname', 'Continuous EEG Data', 'gui', 'off');
eeglab redraw;Your browser's back button takes you to the exact place you were, so open anything you like.
The idea in brief
An EEGLAB datasetOne EEG data file loaded in EEGLAB together with its information. has two parts: the description (channelThe signal recorded from one electrode, as shown in EEGLAB. names and positions, events, sampling rateThe number of samples recorded per second on each channel., processing history) and the signalValues that change over time, such as the voltage recorded on a channel. itself (the numbers in EEG.data).
Before and after
Your next questions, each answered in its own section:
Why do I need this step?
The reasons in detail, and the terms you need
In EEGLAB 2026.1, saving writes the two parts to two files with the same name by default: a .set file with the description and a .fdt file with the signal. The sampleA single value of the signal at one point in time. eeglab_data.set that ships with EEGLAB is saved the same way. You can also ask for one file that holds both parts.
A .set without its .fdt has no signal. If you copy or send the .set file alone, the person who tries to open it gets an error. This lesson shows how to tell the two cases apart and how to keep the two files together.
Why do I need this step?
In EEGLAB 2026.1, saving writes the two parts to two files with the same name by default: a .set file with the description and a .fdt file with the signal. The sample eeglab_data.set that ships with EEGLAB is saved the same way. You can also ask for one file that holds both parts.
A .set without its .fdt has no signal. If you copy or send the .set file alone, the person who tries to open it gets an error. This lesson shows how to tell the two cases apart and how to keep the two files together.
How do I do it in EEGLAB?
9 steps in the menus
1. See the two files of the sample
- Open the
sample_datafolder inside your EEGLAB folder, in File Explorer on Windows or Finder on macOS. - You will find
eeglab_data.set(about 0.35 MB) andeeglab_data.fdt(about 3.9 MB). The.fdtis the larger one because it holds the signal: 32 channels × 30504 samples × 4 bytes per number.
2. Save a copy in your folder
- With
eeglab_data.setopen in EEGLAB, open File then Save current dataset as. - Go to your own lessons folder, not
sample_data, and type the nameD1_copy.set. - Click Save.
- Look in your folder: there are two files,
D1_copy.set(about 0.35 MB) andD1_copy.fdt(about 3.9 MB). You typed one name, and EEGLAB wrote both files.
3. Find the saving option
- Open File then Preferences.
- In the first group of options, find the checkbox that starts with If set, save not one but two files for each dataset (header and data).
- Close the window with Cancel, and do not click OK. In this course we keep the default: two files.
You may find the checkbox unticked, even though EEGLAB just saved two files. The window reads its value from one settings file, while saving follows another one, until you click OK in this window for the first time. After that, saving follows the checkbox.
How do I do it in EEGLAB?
1. See the two files of the sample
- Open the
sample_datafolder inside your EEGLAB folder, in File Explorer on Windows or Finder on macOS. - You will find
eeglab_data.set(about 0.35 MB) andeeglab_data.fdt(about 3.9 MB). The.fdtis the larger one because it holds the signal: 32 channels × 30504 samples × 4 bytes per number.
2. Save a copy in your folder
- With
eeglab_data.setopen in EEGLAB, open File then Save current dataset as. - Go to your own lessons folder, not
sample_data, and type the nameD1_copy.set. - Click Save.
- Look in your folder: there are two files,
D1_copy.set(about 0.35 MB) andD1_copy.fdt(about 3.9 MB). You typed one name, and EEGLAB wrote both files.
3. Find the saving option
- Open File then Preferences.
- In the first group of options, find the checkbox that starts with If set, save not one but two files for each dataset (header and data).
- Close the window with Cancel, and do not click OK. In this course we keep the default: two files.
You may find the checkbox unticked, even though EEGLAB just saved two files. The window reads its value from one settings file, while saving follows another one, until you click OK in this window for the first time. After that, saving follows the checkbox.
How do I write it as code?
The same steps in 15 lines of MATLAB
% Start EEGLAB and load the sample dataset
[ALLEEG, EEG, CURRENTSET, ALLCOM] = eeglab;
sampleFolder = fullfile(fileparts(which('eeglab')), 'sample_data');
EEG = pop_loadset('filename', 'eeglab_data.set', 'filepath', sampleFolder);
% The sample keeps its signal in a separate file
EEG.datfile % 'eeglab_data.fdt'
dir(fullfile(sampleFolder, 'eeglab_data.*')) % the .fdt and the .set
% Save a copy in your own folder: two files by default in EEGLAB 2026.1
myFolder = 'C:\Users\me\Documents\eeg-course'; % change it
EEG = pop_saveset(EEG, 'filename', 'D1_copy.set', 'filepath', myFolder);
dir(fullfile(myFolder, 'D1_copy.*')) % D1_copy.fdt and D1_copy.set
% Ask for one file explicitly, if you need it
EEG = pop_saveset(EEG, 'filename', 'D1_onefile.set', 'filepath', myFolder, ...
'savemode', 'onefile');
dir(fullfile(myFolder, 'D1_onefile.*')) % D1_onefile.set only, about 4 MBEEG.datfileholds the name of the.fdtfile. When it is empty, the signal is inside the.setfile.'savemode', 'onefile'forces one file for this save only, whatever the preference says.'savemode', 'twofiles'forces two files.
How do I write it as code?
% Start EEGLAB and load the sample dataset
[ALLEEG, EEG, CURRENTSET, ALLCOM] = eeglab;
sampleFolder = fullfile(fileparts(which('eeglab')), 'sample_data');
EEG = pop_loadset('filename', 'eeglab_data.set', 'filepath', sampleFolder);
% The sample keeps its signal in a separate file
EEG.datfile % 'eeglab_data.fdt'
dir(fullfile(sampleFolder, 'eeglab_data.*')) % the .fdt and the .set
% Save a copy in your own folder: two files by default in EEGLAB 2026.1
myFolder = 'C:\Users\me\Documents\eeg-course'; % change it
EEG = pop_saveset(EEG, 'filename', 'D1_copy.set', 'filepath', myFolder);
dir(fullfile(myFolder, 'D1_copy.*')) % D1_copy.fdt and D1_copy.set
% Ask for one file explicitly, if you need it
EEG = pop_saveset(EEG, 'filename', 'D1_onefile.set', 'filepath', myFolder, ...
'savemode', 'onefile');
dir(fullfile(myFolder, 'D1_onefile.*')) % D1_onefile.set only, about 4 MBEEG.datfileholds the name of the.fdtfile. When it is empty, the signal is inside the.setfile.'savemode', 'onefile'forces one file for this save only, whatever the preference says.'savemode', 'twofiles'forces two files.
Which value should I choose?
Suitable values for your analysis goal
| Choice | When | What you get |
|---|---|---|
| Two files (the default in 2026.1) | Almost always, and with a STUDYAn EEGLAB structure that groups many participants' datasets for joint analysis. in station 8, because EEGLAB reads the description alone quickly. | name.set and name.fdt, always together |
One file (untick the option in File then Preferences and click OK, or 'savemode', 'onefile') | You want to email one dataset or copy it without forgetting a file. | name.set only |
Resaving keeps the format on disk. File then Resave current dataset(s) on a two-file dataset writes two files again, even if your preference is one file. In that case the Command Window prints a note starting with Note that your memory options for saving datasets does not correspond. This is normal.
Two files, not one
Some pages of the EEGLAB documentation say that EEGLAB saves one file by default since 2021, and the File then Preferences window says so too. But the settings file that ships with EEGLAB 2026.1 turns the two-file option on, so saving writes two files. Trust what you see in your folder.
Two files, not one
Some pages of the EEGLAB documentation say that EEGLAB saves one file by default since 2021, and the File then Preferences window says so too. But the settings file that ships with EEGLAB 2026.1 turns the two-file option on, so saving writes two files. Trust what you see in your folder.
Which value should I choose?
| Choice | When | What you get |
|---|---|---|
| Two files (the default in 2026.1) | Almost always, and with a STUDY in station 8, because EEGLAB reads the description alone quickly. | name.set and name.fdt, always together |
One file (untick the option in File then Preferences and click OK, or 'savemode', 'onefile') | You want to email one dataset or copy it without forgetting a file. | name.set only |
Resaving keeps the format on disk. File then Resave current dataset(s) on a two-file dataset writes two files again, even if your preference is one file. In that case the Command Window prints a note starting with Note that your memory options for saving datasets does not correspond. This is normal.
Two files, not one
Some pages of the EEGLAB documentation say that EEGLAB saves one file by default since 2021, and the File then Preferences window says so too. But the settings file that ships with EEGLAB 2026.1 turns the two-file option on, so saving writes two files. Trust what you see in your folder.
Two files, not one
Some pages of the EEGLAB documentation say that EEGLAB saves one file by default since 2021, and the File then Preferences window says so too. But the settings file that ships with EEGLAB 2026.1 turns the two-file option on, so saving writes two files. Trust what you see in your folder.
How do I check it worked?
4 quick checks
sample_datahaseeglab_data.setandeeglab_data.fdt, andEEG.datfilegives'eeglab_data.fdt'after loading the sample.- Your folder has
D1_copy.set(about 0.35 MB) andD1_copy.fdt(about 3.9 MB). - If you ran the scriptA MATLAB file of commands that runs processing steps in order.:
D1_onefile.setalone, about 4 MB. D1_copy.setopens with File then Load existing dataset and shows 32 channels and 154 events.
You can delete D1_copy.* and D1_onefile.set after the lesson. The next lessons do not use them.
How do I check it worked?
sample_datahaseeglab_data.setandeeglab_data.fdt, andEEG.datfilegives'eeglab_data.fdt'after loading the sample.- Your folder has
D1_copy.set(about 0.35 MB) andD1_copy.fdt(about 3.9 MB). - If you ran the script:
D1_onefile.setalone, about 4 MB. D1_copy.setopens with File then Load existing dataset and shows 32 channels and 154 events.
You can delete D1_copy.* and D1_onefile.set after the lesson. The next lessons do not use them.
What mistakes do people make?
6 mistakes and how to avoid them
- Copying or emailing the
.setfile alone. Always move both files, with the same name, into the same folder. - Renaming one of the two files in the file explorer. The
.setfile remembers the name of its.fdt. To rename a dataset, open it in EEGLAB and use File then Save current dataset as with the new name. - Opening the
.fdtfile. Always open the.set. EEGLAB reads the.fdtwith it. - An error that starts with
fileand ends withyou must also rename/move the associated data file.The.fdtfile is not next to the.setfile, so the dataset does not open. Find it and put it in the same folder. The sampleeeglab_data.setis an exception: EEGLAB puts thesample_datafolder on the MATLAB path, so MATLAB findseeglab_data.fdtthere even if you copy the.setalone. Your own files are not treated this way. - Clicking OK in File then Preferences by accident. If the two-files checkbox is unticked, saving then writes one file. That is fine, but do not be surprised when your files change.
- Being surprised that the old
.fdtdisappeared. If you save a two-file dataset as one file with the same name in the same folder, EEGLAB deletes the old.fdt, because the signal is now inside the.setfile. It printsOld .fdt file detected on disk, deleting file since the Matlab file now contains all the data. This is why you save your copies in your own folder, never over the sample.
What mistakes do people make?
- Copying or emailing the
.setfile alone. Always move both files, with the same name, into the same folder. - Renaming one of the two files in the file explorer. The
.setfile remembers the name of its.fdt. To rename a dataset, open it in EEGLAB and use File then Save current dataset as with the new name. - Opening the
.fdtfile. Always open the.set. EEGLAB reads the.fdtwith it. - An error that starts with
fileand ends withyou must also rename/move the associated data file.The.fdtfile is not next to the.setfile, so the dataset does not open. Find it and put it in the same folder. The sampleeeglab_data.setis an exception: EEGLAB puts thesample_datafolder on the MATLAB path, so MATLAB findseeglab_data.fdtthere even if you copy the.setalone. Your own files are not treated this way. - Clicking OK in File then Preferences by accident. If the two-files checkbox is unticked, saving then writes one file. That is fine, but do not be surprised when your files change.
- Being surprised that the old
.fdtdisappeared. If you save a two-file dataset as one file with the same name in the same folder, EEGLAB deletes the old.fdt, because the signal is now inside the.setfile. It printsOld .fdt file detected on disk, deleting file since the Matlab file now contains all the data. This is why you save your copies in your own folder, never over the sample.
Your browser doesn't allow saving progress. All lessons are open, but completion marks won't be saved.
Done. Your progress is saved in this browser.UndoWhere can I read more?
1 sources, official docs first
- EEGLAB TutorialDocumentation3. Dataset management: Saving a dataset; Dataset and file preferences
Written for EEGLAB 2026.1 · 2026-10-28
Going further
- EEGLAB Tutorial: https://eeglab.org/tutorials/03_Dataset_management/datasets.html (3. Dataset management: Saving a dataset; Dataset and file preferences)
Need help?
Ask, share feedback, or report an error
- Report a scientific error · Needs a GitHub account. Don't have one? Use "Share your thoughts".